Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Tableau formula to DAX

Hi Team,

 

I am not sure how to write this formula in DAX as it is used in tableau to create a period start date.

 

DATE(
STR([P_Fiscal Year])+ "-"
+
STR(
IF [P_Fiscal Period ] <= 9 THEN "0"+STR([P_Fiscal Period ])
ELSE STR([P_Fiscal Period ]) END
) + "-"
+ "01")
1 REPLY 1
adudani
Super User
Super User

hi @Anonymous ,

 

try creating a calculated column in your table with the following measure.

 

Assuming data types of Year and Fiscal Period = Int/wholenumber  

 

 

 

Period Start Date = 
FORMAT(
DATE( 
    [P_Fiscal Year],
    IF('Table'[P_FiscalPeriod]<=9,"0"&[P_FiscalPeriod],[P_FiscalPeriod]),
    01),
    "yyyy-mm-dd"
)

 

 

 

Sample output is shown.

 

adudani_0-1707772313801.png

 you could also just use:

 

Period Start Date = 
FORMAT(
DATE( 
    [P_Fiscal Year],
    'Table'[P_FiscalPeriod],
    01),
    "yyyy-mm-dd"
)

 

as format handles the "0" in the if condition 



let me know if this works for you.

 

if it doesn't kindly provide sample inputs / specify data types.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos ๐Ÿ™‚
Kind Regards,
Avinash

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)