cancel
Showing results for 
Search instead for 
Did you mean: 
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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.