Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I've used the code below to calculate the difference between two values in a matrix - it does the job, but the actual numbers overrides my dax in regards to the total columns.
e.g. the total column in 'fælles' says that we have a total of above 800.000 but is in fact only 7.571.
Also I had to manipulate data to remove the numbers where total = 0 - but it is not on purpose that that the total is zero, it should be the sum of the columns ..
Difference =
VAR thisforecastnum =
MIN ( Costcenter[Kost center] )
VAR thisforecast =
SUM ( Costcenter[Faktisk Beløb] )
var lastforecastnum=CALCULATE(MAX('Costcenter'[Kost center]),FILTER(ALLSELECTED(costcenter),'Costcenter'[Kost center]<MAX('Costcenter'[kost center])))
VAR lastforecast =
CALCULATE (
SUM ( Costcenter[Faktisk Beløb] ),
Costcenter[Kost center] = lastforecastnum
)
RETURN
IF (
ISBLANK (lastforecast),
SUM ( Costcenter[Faktisk Beløb]),
IF(max('costcenter'[Kost center]) = "Fælles",
lastforecast - thisforecast,
BLANK()
)
)
new_amount = IF(
IF(sum('Costcenter'[Faktisk Beløb]) == Costcenter[Difference] && max(costcenter[Kost center]) = "fælles",
BLANK() + 0,
sum(Costcenter[Faktisk Beløb])),
IF(sum('Costcenter'[Faktisk Beløb]) <> Costcenter[Difference] && max(costcenter[Kost center]) = "fælles",
costcenter[Difference],
sum(Costcenter[Faktisk Beløb]))
)
Solved! Go to Solution.
Hi @Spanggaard ,
Based on your description, you can create a measure.
Measure =
SUMX(
SUMMARIZE(
'Table',
'Table'[RowName],
'Table'[ColumnName],
"total",SUM ( 'Table'[Your Measure] )
),
[total]
)
You can refer to the following documents that may be helpful to you:
How to Make Measures Total Correctly in Power BI Tables - ArcherPoint
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Spanggaard ,
Based on your description, you can create a measure.
Measure =
SUMX(
SUMMARIZE(
'Table',
'Table'[RowName],
'Table'[ColumnName],
"total",SUM ( 'Table'[Your Measure] )
),
[total]
)
You can refer to the following documents that may be helpful to you:
How to Make Measures Total Correctly in Power BI Tables - ArcherPoint
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |