Forum Discussion
Question about Power Bi Dekstop incorrect total value
Hello Community,
I have a question and a problem with my calculation when I filter
The total values are unfortunately not correct. Cost should be 20314,20 Euro and costaggretierteuro 14175,75 Euro.
I have the following tables.
1 Table with Valuenames
2 fact tables with cost (as a total) and the other fact table (costaggregierteuro (as a total).
I filter by the valuenames and the problem only occurs when I select all valuenames or 2 or more. If I select only one value, the calculation is correct.
If I execute all this in T-SQL then I get the correct values.
What am I doing wrong?
If you need more information, please ask.
Many thanks in advance.
Spaceman127
- Anonymous2 years ago
Hi spaceman127 ,
You can create another two measures as below to get it:
Sum of Cost= SUM('facttable1'[cost])New_sumofcost=sumx(values('dimAzTags'[Valuename]),[Sum of Cost])Sum of costaggregierteuro= SUM('facttable1'[costaggregierteuro])New_sumofcostagg=sumx(values('dimAzTags'[Valuename]),[Sum of costaggregierteuro])In addition, you can refer the following links to try to solve your problem...
Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand
Dax for Power BI: Fixing Incorrect Measure Totals
Best Regards
4 Replies
- sanalyticsSuper User
Hello spaceman127
You can Try this Measure for cost
Cost = Sumx( YourTable[ValueName],[Cost] )
It will great if you can share the pbix file.Hope it will help you.
regards
sanalytics
If it is your solution then please like and accept it as solution
- spaceman127Super User
Thank you for your answer, I can't share the pbix because it contains data that I can't pass on.
I have taken a screenshot of the data model.
Sorry for the inconvenience.
I have now extended the data model as it actually looks now.
I practically filter the value name (dimAzTags) and then get the resources with the costs that have a tag.
My assumption is that the relationship between the dimAzTags table and the resource table is the problem.
Unfortunately I can't solve this easily.
It would be better to adjust the measure if that is possible.
Does that help?
Thanks in advance.
spaceman127
- AnonymousNot applicable
Hi spaceman127 ,
You can create another two measures as below to get it:
Sum of Cost= SUM('facttable1'[cost])New_sumofcost=sumx(values('dimAzTags'[Valuename]),[Sum of Cost])Sum of costaggregierteuro= SUM('facttable1'[costaggregierteuro])New_sumofcostagg=sumx(values('dimAzTags'[Valuename]),[Sum of costaggregierteuro])In addition, you can refer the following links to try to solve your problem...
Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand
Dax for Power BI: Fixing Incorrect Measure Totals
Best Regards