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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX Help

Hi experts, below measure is giving wrong results in case of december month, please help

 

YEAR - MONTH  =
IF DAY('CALENDAR'[Date]) > 25 ,
CONCATENATE( YEAR('CALENDAR'[Date]) & "-" , MONTH('CALENDAR'[Date]) +1 ),
CONCATENATE( YEAR('CALENDAR'[Date]) & "-" , MONTH('CALENDAR'[Date]) )
)
 
Desired result =

25-11-2021 = 11-2021

26-11-2021 = 12-2021

 

25-12-2021 = 12-2021

26-12-2021 = 01-2022

6 REPLIES 6
Anonymous
Not applicable

Hi  @Anonymous ,

 

Which time intelligence are you referring to, maybe there are other alternative functions

If it doesn't work, it may also be related to the all() function inside. When the all() function is not used, at the day level we would always get one row from the calendar table, and when the all() function is used, the entire date table is returned.

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Time-intelligence-issues/m-p/1286680

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Sorry for late reply. Time to have diner here.

Your time intelligence work for other calculation in your PBIX ?

Anonymous
Not applicable

Sorry


This one should be ok

YEAR - MONTH  =

IF ( DAY('CALENDAR'[Date]) > 25 && MONTH('CALENDAR'[Date])=12,

CONCATENATE( YEAR('CALENDAR'[Date])+1 & "-" , « 01 »),

IF ( DAY('CALENDAR'[Date]) > 25 ,

CONCATENATE( YEAR('CALENDAR'[Date]) & "-" , MONTH('CALENDAR'[Date])+1 ),

CONCATENATE( YEAR('CALENDAR'[Date]) & "-" , MONTH('CALENDAR'[Date])))

Anonymous
Not applicable

Hi

 

Please try this

 

YEAR - MONTH  =
IF DAY('CALENDAR'[Date]) > 25 ,if(month('CALENDAR'[Date])<12,
CONCATENATEYEAR('CALENDAR'[Date]"-" , MONTH('CALENDAR'[Date]) +1 ),
CONCATENATEYEAR('CALENDAR'[Date]) & "-" , MONTH('CALENDAR'[Date]) )
))
Anonymous
Not applicable

@Anonymous my requirement is different, 

 

25-11-2021 = 11-2021

26-11-2021 = 12-2021

 

25-12-2021 = 12-2021

26-12-2021 = 01-2022

Anonymous
Not applicable

@Anonymous  yes , It will work. wondering why time intelligence is not working here. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI 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.

Top Solution Authors
Top Kudoed Authors