Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I have a calculated column where i am calculated the risk based on a number of variables. I would like to change this slightly so that in addition to the below, if the month and year of the 2 dates are equal, i would set the risk to medium. The 2 dates to compare are both date only formatted fields (Gantt_date and FISCAL_FIRST_OF_MONTH).
Solved! Go to Solution.
Hi @ttocso ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @wdx223_Daniel for the prompt response.
FORMAT() is not supported in calculated columns. Instead, compare year and month directly with YEAR() and MONTH():
IF (
YEAR ( 'Table'[Gantt_trend_date] ) = YEAR ( 'Table'[FISCAL_FIRST_OF_MONTH] )
&& MONTH ( 'Table'[Gantt_trend_date] ) = MONTH ( 'Table'[FISCAL_FIRST_OF_MONTH] ),
"Medium"
)
Embed this inside your existing risk logic. This way the column correctly sets risk to Medium when both dates fall in the same year and month.
it is ok in my PBI App?
Hi @ttocso ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @wdx223_Daniel for the prompt response.
FORMAT() is not supported in calculated columns. Instead, compare year and month directly with YEAR() and MONTH():
IF (
YEAR ( 'Table'[Gantt_trend_date] ) = YEAR ( 'Table'[FISCAL_FIRST_OF_MONTH] )
&& MONTH ( 'Table'[Gantt_trend_date] ) = MONTH ( 'Table'[FISCAL_FIRST_OF_MONTH] ),
"Medium"
)
Embed this inside your existing risk logic. This way the column correctly sets risk to Medium when both dates fall in the same year and month.
Many thanks app, appreciate the support. I can confirm this works as expected.
Thx for the reply. It says FORMAT is an unknown or unsupported function?
If(FORMAT(Gantt_trend_date,"YYMM")=FORMAT(FISCAL_FIRST_OF_MONTH,"YYMM"),"Medium",
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.