Forum Discussion
Wrong Total
Hi Anonymous ,
As per our understanding, you are looking for a way to get the total of Value 1 and Value 2 based on the Country cell value,
In Power BI, I think we cannot access the columns of the table and we need to use selectedvalue in the Measure 1 and Measure 2 to get specific column’s current value within each row,
Can you try to replace your measures with below DAX expression to check if works?
Measure_1 = var F_Val = if(SELECTEDVALUE(SampleTable[Country])="US",SUM(SampleTable[Value1]),SUM(SampleTable[Value2]))
var Summ = SUMMARIZE(SampleTable,SampleTable[ColumnA],"Val",F_Val)
var Result = SUMX(Summ,[Val])
return Result
Measure_2 = IF(SELECTEDVALUE(SampleTable[Country]) = "US",SUM(SampleTable[Value1]),SUM(SampleTable[Value2]))
Measure_3 =
var Summ = SUMMARIZE(SampleTable,SampleTable[ColumnA],"Val1",SUM(SampleTable[Value2]))
var result = IF(HASONEVALUE(SampleTable[ColumnA]),[Measure_2],SUMX(Summ,[Val1]))
return result
Please Refer the below Screenshot,
Still, if the above screenshot doesn't satisfy your requirement, then you can provide us the expected output by hiding the sensitive data.
Thanks!
Inogic Professional Services Division
Power Platform and Microsoft Dynamics 365 CRM Development – All under one roof!
Drop an email at [email protected]
Services: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
- Anonymous3 years agoNot applicable
HI SamInogic the measure gives correct values in row but the overall total I get is wrong