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
Bhaveshp
Helper III
Helper III

How to calculate Total Variance for January month

Hello, 

 

I am struck at how can we calculate the total variance for January month for a particular project. 

I came to know that the total variance for January month = (Current month Variance) - (Baseline Dec month Variance)

I have Variance columns in the table. How can I create calculation part to get the total variance for a particular project?

Help needed, thanks in advance.

 

Bhavesh

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

If you do not have a date table, you need to create a date table (Date dimension) and connect your snapshot date to the date in newly created date table. 

 

Then create 3measures

1- YTD Current Month := TOTALYTD(SUM('Project Costs'[Variance]), Date[date])
2- YTD Prior Month := CALCULATE( [YTD Current Month], PREVIOUSMONTH(Date[Date]))
3- MTD (January) := [YTD Current Month] - [YTD Prior Month]

View solution in original post

Yes, I got it, Thank you @Anonymous for your help 🙂

View solution in original post

7 REPLIES 7
Phil_Seamark
Employee
Employee

Hi @Bhaveshp

 

If you post a sample set of your table, we can suggest calculations that will fit your model


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

This is my sample table looks like. 

Table name: Project Costs 

Columns: Project_Number, Variance, POC, Region, Country, Currency_rate, Variance USD

 

Table.PNG     

 

For the above table 'Project Costs' I am trying to find Total variance and POC so that I will get YTD and MTD values

YTD= Total Variance*POC

MTD= (Total variance current month) - (Total variance previous month)

 

I have POC values column so I need Total Variance in order to find out YTD and MTD.

 

total variance for January month = (Current month Variance) - (Baseline Dec month Variance)

 

Please help me, thanks @Phil_Seamark

 

 

 

Hi @Phil_Seamark

 

Thanks for your response. I tried to calculate Total Variance and YTD values by using the below measures

Total Variance = (SUM('Project Costs'[Variance])-CALCULATE(SUM('Project Costs'[Variance]), PREVIOUSMONTH('Project Costs'[Snapshot Date].[Date])))*-1

 

YTD (January) = YTD Savings Cost reduction(+) / Cost increase(-) = ([Total Variance] * AVERAGE('Project Costs'[POC]))/100

 

But I am unable to find out MTD values for the table. 

MTD (January) = YTD (January) - YTD (December), this is the calculation.

 

But how can measure MTD values in Power BI report? Please help me, thanks 

 

Bhavesh

Anonymous
Not applicable

If you do not have a date table, you need to create a date table (Date dimension) and connect your snapshot date to the date in newly created date table. 

 

Then create 3measures

1- YTD Current Month := TOTALYTD(SUM('Project Costs'[Variance]), Date[date])
2- YTD Prior Month := CALCULATE( [YTD Current Month], PREVIOUSMONTH(Date[Date]))
3- MTD (January) := [YTD Current Month] - [YTD Prior Month]

Yes, I got it, Thank you @Anonymous for your help 🙂

HI @Bhaveshp

 

Do you have a Date (or Calendar) table in your model connected to this table?  

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Yes @Phil_Seamark I have Snapshot Date in my table. 

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.