Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I found it surprisingly difficult to calculate percentages in DAX. I finally came up with the following:
Hi @mbug123 ,
In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?
Thanks for your efforts & time in advance.
Best regards,
Community Support Team_Binbin Yu
Many thanks. I used your code. Unfortunately, still no totals ;(
@mbug123 Hi! Change it to:
overall_% =
DIVIDE(
SELECTEDVALUE(a_fact_results[no_responses]),
SELECTEDVALUE(a_fact_results[base]),
0
)
In this updated expression, I've used the DIVIDE function instead of the division operator (/) to handle the case where the denominator is zero (to avoid errors). The SELECTEDVALUE function still retrieves the values for no_responses and base, but by using DIVIDE, it will correctly display totals in your matrix table.
BBF
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
7 |