cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jengwt Member
Member

Re: Last Month calculations do not work in January

@v-yuezhe-msft It will be difficult to resolve this after January and the functions resume working "correctly" again.

Want to try having a call?

jengwt Member
Member

Re: Last Month calculations do not work in January

Ok I figured it out. It's actually pretty simple; you just explicitely tell PBI what to do in January:

 

Population_LM =
VAR LMDs = [LM_Days]
VAR DN = [DNOW]
VAR MDN = MONTH(DN)
VAR YDN = YEAR(DN) RETURN ROUND( DIVIDE( CALCULATE( SUM('Population'[COUNT]) , CALCULATETABLE('Population' , MONTH('BI-DATE_DIM'[DIM_DATE]) = IF(MDN = 1 , 12 , MDN ) && YEAR('BI-DATE_DIM'[DIM_DATE]) = IF(MONTH(DN) = 1 , YDN - 1 , YDN ) ) ) , LMDs ) , 0 )

and,

 

Loss_LM = -- STATIC CALC
VAR DN = [DNOW]
VAR MDN = MONTH(DN)
VAR YDN = YEAR(DN) RETURN CALCULATE( COUNT('Losses'[ID]) , CALCULATETABLE(Losses' , MONTH('BI-DATE_DIM'[DIM_DATE]) = IF(MDN = 1 , 12 , MDN ) && YEAR('BI-DATE_DIM'[DIM_DATE]) = IF(MDN = 1 , YDN - 1 , YDN ) ) )

 

I still think those PREVIOUS...() functions don't really work as envisioned.

Moderator v-yuezhe-msft
Moderator

Re: Last Month calculations do not work in January - Status changed to: Delivered

 
Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jengwt Member
Member

Re: Last Month calculations do not work in January - Status changed to: Delivered

@v-yuezhe-msft I would have, but it wouldn't let me mark my own reply as a solution. Thank you for doing so.

jengwt Member
Member

Re: Last Month calculations do not work in January - Status changed to: Delivered

@v-yuezhe-msft I would like to state that just because I found a workaround doesn't mean the root problem is resolved. I disagree with the status being "delivered", and suggest that Microsoft still take this up as a bug.

Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 135 members 1,690 guests
Please welcome our newest community members: