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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Conditional difference versus previous period

Hello folks,

 

I have been struggling on this headcount report for a while..

I want to show the headcount variation versus previous period, which I managed to do with:

 

BUD_PREV_PERIOD = CALCULATE(sum(Headcount1[BUD]);DATEADD(Headcount1[PERIOD].[Date];-1;MONTH))

and then calculating the difference between Budget and BUD_prev_period.

 

Now I want to split that value into 2 options (measures/columns): is the headcount difference part of a certain regional plan or not (see the -1 below). I thought it would be easy with a SUMX or so but I don't get there...

 

Diff FOR REGION = SUMX(FILTER(Headcount1;Headcount1[REGIONAL PLAN]="YES");[BUD_diff])

 

Do you have any ideas? Many thanks!!

 

PeriodNameRegion planBudget       
2019/1Person1Yes1 Final table2019/12019/22019/32019/42019/5
2019/2Person1Yes1 Total Headcount21100
2019/3Person1Yes1 Diff prev period -10-10
2019/4Person1Yes0 Diff (Regional plan)   -1 
2019/5Person1Yes0 Diff (no plan)0-1000
2019/1Person2No1       
2019/2Person2No0       
2019/3Person2No0       
2019/4Person2No0       
2019/5Person2No0       
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

I believe this is the result you want.  You may download my PBI file from here.

 

Hope this helps.

 

Reginoal plan diff.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

 

I believe this is the result you want.  You may download my PBI file from here.

 

Hope this helps.

 

Reginoal plan diff.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.