Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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