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
sheidari81
Regular Visitor

Calculating Variance: one month vs prior month

I am struggling with the formula to calculate the variance between two months. I have a table that has FTE counts by month for the fiscal year. I need to track the variance by month. So each month will subtract the prior month FTE count to see if there was any change.  I've tried several Dax formulas but none of them seem to work.  

 

Input Table:

This is where the user inputs their FTE count by month, per person. 

 

 

PP Troubleshoot 1.JPG 

 

 

 

 

 

 

 

 

 

 

 

 

FY17 Changes:

This is what the calculation should do...take the variance compared to the prior month (see formula bar).

PP Troubleshoot 6.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Calendar Table:

Here is my calendar table in PowerPivot

PP Troubleshoot 5.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Calculated Measures:

Here are the 3 different calculated measures I tried and none replicate the results in the FY17 changes image.

 PP Troubleshoot 4.JPGPP Troubleshoot 3.JPGPP Troubleshoot 2.JPG

 

 

2 ACCEPTED SOLUTIONS
mattbrice
Solution Sage
Solution Sage

First off, your Calendar table is not a true calendar table that is required for the Time Intelligence functions to work properly.   Calendar table should every day date for full years and "Marked as Date Table".  Time Intelligence functions make some assumptions that require the full calendar.

Second, date functions work by shifting the visible dates in filter context which means the date must exist in the calendar to be a filter.  No dates are "created".

Third, how are the tables related?  Nice to see map + which fields are linked.

 

What you want to do is pretty easy if the model is setup correctly. From what i can tell of your screenshots you are really close.

 

View solution in original post

If you have a standard calendar table with all dates, you just need to link it to the "fact" table column that also has dates ( your has FirstDay, LastDay, etc columns.).  You don't care if the fact table doesn't have all dates inclusive.  And usually visuals don't show dates were measure returns blank.

View solution in original post

4 REPLIES 4
mattbrice
Solution Sage
Solution Sage

First off, your Calendar table is not a true calendar table that is required for the Time Intelligence functions to work properly.   Calendar table should every day date for full years and "Marked as Date Table".  Time Intelligence functions make some assumptions that require the full calendar.

Second, date functions work by shifting the visible dates in filter context which means the date must exist in the calendar to be a filter.  No dates are "created".

Third, how are the tables related?  Nice to see map + which fields are linked.

 

What you want to do is pretty easy if the model is setup correctly. From what i can tell of your screenshots you are really close.

 

Thanks, @mattbrice.  I got it to work. This was very helpful.  

 

One question...If my data table is only capturing data by month, how would I link it to a calendar table that is at the day level?

If you have a standard calendar table with all dates, you just need to link it to the "fact" table column that also has dates ( your has FirstDay, LastDay, etc columns.).  You don't care if the fact table doesn't have all dates inclusive.  And usually visuals don't show dates were measure returns blank.

sheidari81
Regular Visitor

anyone?

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.