March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello community,
I would like to calculate a difference absolute and percent between two columns in my visualisation.
My data looks like this:
LEVEL | DATE | REVENUE |
Actual | January | 100 |
Budget | January | 110 |
Actual | February | 90 |
Budget | February | 95 |
Actual | March | 115 |
Budget | March | 105 |
Actual | April | 130 |
Budget | April | 120 |
I want to have the following matrix with the difference column Actual vs Budget.
DATE | ACTUAL | BUDGET | Diff | |
January | 100 | 110 | -10 | |
February | 90 | 95 | -5 | |
March | 115 | 105 | +10 | |
April | 130 | 120 | +10 | |
Is this possible?
I would be very grateful for your help.
Solved! Go to Solution.
Hi @dopingcontrol ,
Arul use PIVOT function in Power Query to achieve your goal. This way will transform your data model. If you don't want to transform your table, you can try to create a measure to show difference in Total and rename "Total" by "Diff".
Measure =
VAR _REVENUE = SUM('Table'[REVENUE])
VAR _ACTUAL = CALCULATE( SUM('Table'[REVENUE]),'Table'[LEVEL] = "Actual")
VAR _Budget = CALCULATE( SUM('Table'[REVENUE]),'Table'[LEVEL] = "Budget")
RETURN
IF(HASONEVALUE('Table'[LEVEL]),_REVENUE,_ACTUAL - _Budget)
Then create a matrix visual.
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dopingcontrol ,
Arul use PIVOT function in Power Query to achieve your goal. This way will transform your data model. If you don't want to transform your table, you can try to create a measure to show difference in Total and rename "Total" by "Diff".
Measure =
VAR _REVENUE = SUM('Table'[REVENUE])
VAR _ACTUAL = CALCULATE( SUM('Table'[REVENUE]),'Table'[LEVEL] = "Actual")
VAR _Budget = CALCULATE( SUM('Table'[REVENUE]),'Table'[LEVEL] = "Budget")
RETURN
IF(HASONEVALUE('Table'[LEVEL]),_REVENUE,_ACTUAL - _Budget)
Then create a matrix visual.
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes it is possible!!
You need to pivot your table in power query editor based on date column,
Then,
write the below measure and use actual,budget and measure in the matrix visual.
Thanks,
Arul
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
12 | |
9 | |
7 |
User | Count |
---|---|
38 | |
32 | |
29 | |
12 | |
11 |