Forum Discussion
DAX Help
Hi experts, below measure is giving wrong results in case of december month, please help
25-11-2021 = 11-2021
26-11-2021 = 12-2021
25-12-2021 = 12-2021
26-12-2021 = 01-2022
6 Replies
- AnonymousNot applicable
Hi
Please try this
YEAR - MONTH =IF ( DAY('CALENDAR'[Date]) > 25 ,if(month('CALENDAR'[Date])<12,CONCATENATE( YEAR('CALENDAR'[Date]) & "-" , MONTH('CALENDAR'[Date]) +1 ),CONCATENATE( YEAR('CALENDAR'[Date]) & "-" , MONTH('CALENDAR'[Date]) )))- AnonymousNot 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
- AnonymousNot applicable
Anonymous yes , It will work. wondering why time intelligence is not working here.
- AnonymousNot applicable
Sorry
This one should be okYEAR - 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])))
- AnonymousNot applicable
Sorry for late reply. Time to have diner here.
Your time intelligence work for other calculation in your PBIX ?
- AnonymousNot 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.