March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I have the following Matrix with Questions and Answers as columns and rows headers (2 different tables).
If I export the table I have this:
I'm trying to insert the percentage per question beside each count of question*answer like shown in the table below highlighted in yellow
Is that something doable in Power BI?
Solved! Go to Solution.
Thank you Wilson,
After reading and reading in Google for possible solutions, I found that there is a native option called Percent of Row total (see screenshot below) that does exactly what I was looking for, I just needed to put the same field as a Value and select this option and that was it:
This is the final result:
Thank you for your help!
Hi Wilson,
I actually have 2 tables, 1 for Questions (it's a fact table so contains more than just questions but to be simple let's call it Questions) and 1 for Answers, and in the Questions table I have the reference Answer Key to only 1 Answer as only 1 Answer can be picked per Question. The solution you proposed works fone if I have only 1 table. I appreciate the time you spend in this question. Thanks.
Jonatan,
In that case, I suspect there's a chance the measure would still work if you change the REMOVEFILTER to instead be REMOVEFILTERS ( Answers[Answer] ).
If that doesn't work, can you share a screenshot of the Model view from your pbix? Also, does the matrix row come from the Questions fact table and the matrix column from the Answers (dimension?) table?
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
Proud to be a Super User! | |
Hello Jonatan,
Yes, this is doable in Power BI.
Assuming this is the only table in your data model, the measure would look something like this:
AnswerPercentage =
VAR TotalAnswers =
CALCULATE (
SUM ( Table1[#] ),
REMOVEFILTERS ( Table1[Answers] )
)
RETURN
DIVIDE (
SUM ( Table1[#] ),
TotalAnswers
)
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
Proud to be a Super User! | |
Hi Wilson,
It didn't work, returned 1 for all cells:
I created the measure like this:
This is the model:
Jonatan,
What if you turn off bi-directional filtering between the two tables? Generally speaking, one-to-many relationships should only go in one direction.
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
Proud to be a Super User! | |
Thank you Wilson,
After reading and reading in Google for possible solutions, I found that there is a native option called Percent of Row total (see screenshot below) that does exactly what I was looking for, I just needed to put the same field as a Value and select this option and that was it:
This is the final result:
Thank you for your help!
Excellent, glad you figured it out jonatan. 😄
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
22 | |
19 | |
16 | |
9 | |
5 |
User | Count |
---|---|
37 | |
28 | |
16 | |
14 | |
12 |