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.
Hello I have a problem with a Dax calc.
I need to divide the sum of Metingtest 2 by count Metingtest. That results in Metingtest3. And that result is correct.
However in the bottom , you see 52488 .That is the result of the total divided by total count. (264382263/5037)
But I need to have the sum of Metingtest3 (so all results of that column summed up)
How can I accomplish that?
So calculation of Metingtest3 = sum(budgetrow)/Count(budgetrow)
Hopefully I am explaning myself in a good way... 🙂
Solved! Go to Solution.
Hi @Arendp ,
I think it needs to be something like this:
AvgRowAndTotal =
// My Dummy MetingTest3Berekening = Divide(sumx ( sales, Sales[Quantity] * Sales[Net Price]),sum(Sales[Quantity]))
Var RowOrTotal =
IF ( ISFILTERED('Product'[Category]), -- replace Product[Category] with your own fields
Divide(sumx ( sales, Sales[Quantity] * Sales[Net Price]),sum(Sales[Quantity])),
SUMX(
Summarize ( -- create temporary table with the same subtotals
Sales, -- you can check them in DAX studio
'Product'[Category],
"rowtotal", Divide(sumx ( sales, Sales[Quantity] * Sales[Net Price]),sum(Sales[Quantity]))
)
, [rowtotal])
)
return RowOrTotal
Hope this helps,
Jan
Are they columns or measure?
For column you have hasonevalue function.
There are more threads for total is wrong on community you can check those.
Thanks,
Pravin
Hi @Arendp ,
I think it needs to be something like this:
AvgRowAndTotal =
// My Dummy MetingTest3Berekening = Divide(sumx ( sales, Sales[Quantity] * Sales[Net Price]),sum(Sales[Quantity]))
Var RowOrTotal =
IF ( ISFILTERED('Product'[Category]), -- replace Product[Category] with your own fields
Divide(sumx ( sales, Sales[Quantity] * Sales[Net Price]),sum(Sales[Quantity])),
SUMX(
Summarize ( -- create temporary table with the same subtotals
Sales, -- you can check them in DAX studio
'Product'[Category],
"rowtotal", Divide(sumx ( sales, Sales[Quantity] * Sales[Net Price]),sum(Sales[Quantity]))
)
, [rowtotal])
)
return RowOrTotal
Hope this helps,
Jan
That helped, thanks!!
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |