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

FY17 Changes:

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

Calendar Table:

Here is my calendar table in PowerPivot

Calculated Measures:

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

2 ACCEPTED SOLUTIONS
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.

Solution Sage

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.

4 REPLIES 4
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.

Regular Visitor

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?

Solution Sage

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.

Regular Visitor

anyone?

Announcements

#### 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.

#### 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!

#### Business Application LATAM Summit 2023

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

#### 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.

Top Solution Authors
Top Kudoed Authors