Forum Discussion
Wrong Total
Hey,
it's not totally clear, what's wrong (at least not for me)
Can you please explain what the number 11688 (Task) for Solution "A" represents
- a task id
- the no of tasks meaning the number of rows filter implicitly by Solution "A"
What is your expected result? And what does the Measure = Count('tablename'[Task] return for each row and also the total value.
Regards,
Tom
Hi There,
What i am trying to achieve here is :
Divide sum of amount with count of task, now what i am getting in Power BI is
Now the expected result is
Basically Power BI should return the sum of the measure i.e 17500, but it is returning 2500 which is 17500/7, how can i get the sum of the measure as total in Power BI.
Thanks
- AbhishekPandey7 years agoHelper I
Hi,
Just want to update here, i have used
SUMX(VALUES(table1[Solution]), CALCULATE(SUM(Table2[Amount]))/CALCULATE(COUNT(task)))
and the total seems working fine for solution only, but when i drag some other dimension attribute then, it divide the values correctly, but returns an incorrect total.
Thanks,
- v-yulgu-msft7 years agoMicrosoft Employee
Hi AbhishekPandey ,
SUMX(VALUES(table1[Solution]), CALCULATE(SUM(Table2[Amount]))/CALCULATE(COUNT(task)))and the total seems working fine for solution only, but when i drag some other dimension attribute then, it divide the values correctly, but returns an incorrect total.
What "other dimension" did you add? It looks like there are two related tables in your scenario, would you please post sample data in source tables?
Regards,
Yuliana Gu
- AbhishekPandey7 years agoHelper I
Hi,
All the fields that i have used in the screenshot, in my previous replies are from same table only.
SUMX(VALUES(table1[Solution]), CALCULATE(SUM(Table2[Amount]))/CALCULATE(COUNT(task)))
What happening is, when i use drag solution and this measure together in form of a table, then it divides the values correctly, and the total in bottom seems correct as well.
But when i use some other dimensional attribute, for example, name then it divdes the values correctly, but the total seems to be incorrect.
The reason that, it is working fine with solution might be that i have used solution is the measure, SUMX(VALUES(table1[Solution])
that is why it is working correctly with solution.
But when i use this measure with name, then it did not worked correctly, in order to make it work for name also, i should use SUMX(VALUES(table1[Name]) instead of SUMX(VALUES(table1[Solution]).
I should not use any dimensional attribute in the values in DAX, to make it work with every dimensional attribute.
If you check my sceenshots, then you will understand what exactly i need as output.