Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
HI Team,
i unpivoted 5 columns into one column namely agetype and value.
I am getting wrong totals for products as shown in the image. it is calculating 5 times the total ap balance for a given vendor, thereby giving wrong totals.
please advice on how to resolve this.
Solved! Go to Solution.
hi, @Anonymous
For your case, you could try this way:
this is my basic sample data
Now I unpivot the columns(Type1...Type5)
Now use AVERAGE and SUMX Function to create a measure like this:
Measure = var _table=SUMMARIZE('Table','Table'[Vendor]) return SUMX(_table,AVERAGE('Table'[Qty]))
Result:
Here is my sample pbix file, please try it.
If it is not your case, please share sample pbix file and expected output . You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.
By the way: there is a measure totals knowledge for this case. See the post about it here:
Best Regards,
Lin
Same issue, but in my case the instead of numbers i have a string and the calculation doesn't work any tips ?
hi, @Anonymous
For your case, you could try this way:
this is my basic sample data
Now I unpivot the columns(Type1...Type5)
Now use AVERAGE and SUMX Function to create a measure like this:
Measure = var _table=SUMMARIZE('Table','Table'[Vendor]) return SUMX(_table,AVERAGE('Table'[Qty]))
Result:
Here is my sample pbix file, please try it.
If it is not your case, please share sample pbix file and expected output . You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.
By the way: there is a measure totals knowledge for this case. See the post about it here:
Best Regards,
Lin
Thanks Lin @v-lili6-msft
This worked for me !! thanks for your example; which made it easier to understand.
Regards,
Ronak
Thanks Lin @v-lili6-msft
This worked for me !! thanks for your example; which made it easier to understand.
Regards,
Ronak
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
91 | |
84 | |
76 | |
65 |
User | Count |
---|---|
145 | |
109 | |
109 | |
102 | |
96 |