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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
alycianw
Frequent Visitor

Variance between values in same column based on specific category

I think I need a DAX command but I am new and not sure the best way to accomplish my need.

I have 2 columns "Values" and "Version". I need to calcuate the variance between the Acutals and the Budget for each vendor.

Is this a measure I need to add or do I need to transform my data so its in different columns?

Below is the chart I am using and need to add a 'Variance' Column too and will need to use the Variance data for other graphs as well
Power BI Chart.png
This is some of the file I am using to show how the data is uploaded.
Power BI Data1.png
Thank you so much in advance for any assistance and advice.

3 ACCEPTED SOLUTIONS
govindarajan_d
Super User
Super User

Hi @alycianw,

 

I see that Actuals and Budget are two different sets of rows in the table. I would suggest pivoting the table, but I see there is something called as Forecast as well. If you think you can have actuals, budget and forecast for every unique row by pivoting you can do that. 

 

If you don't want to pivot, you can try this DAX measure:

Variance = 
VAR __Actual = CALCULATE(Table[Value],Table[Version]="Actuals")
VAR __Budget = CALCULATE(Table[Value],Table[Version]="Budget")
VAR __Variance = __Actual - __Budget
RETURN __Variance

View solution in original post

Hi @alycianw,

 

Did the solution work?

 

If so, please accept as a solution!

View solution in original post

JamesFR06
Resolver IV
Resolver IV

HI,

 

Try this

 

Measure Variance=

VAR __Actual = CALCULATE(Table[Value],Table[Version]="Actuals",allexcept(Table[Vendor])
VAR __Budget = CALCULATE(Table[Value],Table[Version]="Budget",allexcept(Table[Vendor])
VAR __Variance = __Actual - __Budget
RETURN __Variance

View solution in original post

4 REPLIES 4
JamesFR06
Resolver IV
Resolver IV

HI,

 

Try this

 

Measure Variance=

VAR __Actual = CALCULATE(Table[Value],Table[Version]="Actuals",allexcept(Table[Vendor])
VAR __Budget = CALCULATE(Table[Value],Table[Version]="Budget",allexcept(Table[Vendor])
VAR __Variance = __Actual - __Budget
RETURN __Variance

govindarajan_d
Super User
Super User

Hi @alycianw,

 

I see that Actuals and Budget are two different sets of rows in the table. I would suggest pivoting the table, but I see there is something called as Forecast as well. If you think you can have actuals, budget and forecast for every unique row by pivoting you can do that. 

 

If you don't want to pivot, you can try this DAX measure:

Variance = 
VAR __Actual = CALCULATE(Table[Value],Table[Version]="Actuals")
VAR __Budget = CALCULATE(Table[Value],Table[Version]="Budget")
VAR __Variance = __Actual - __Budget
RETURN __Variance

Hi @alycianw,

 

Did the solution work?

 

If so, please accept as a solution!

Currently it is not working I am still trying to get it to work for me. If/when it does I will let you know and accept it.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.