The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |