Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I am trying to write a dax for a table where I am planning on showing the percentage for the 3 groups that I have. So I want the data to look like this:
Group | Distinct Events | % of events |
A | 6000 | 28% |
B | 10000 | 48% |
C | 5000 | 24% |
Total | 21000 | 100% |
I have a slicer right beside this tabe where I have the 3 groups listed. The problem is, when I click on one of the groups, the data shows up like this:
Group | Distinct Events | % of events |
A | 6000 | 100% |
Total | 6000 | 100% |
I created a measure using the Event ID like this:
Distinct Events = DISTINCTCOUNT(Event[EventID])
I used this measure in the table and used the same measure again and clicked "show value as percentage of grand total". I am wondering, is there a way that I can create a dax measure for the percentage values only for "% of events" so that when I click on one of the groups in the slicer, it will show the correct percentage. For example if I click group A, it will show up as:
Group | Distinct Events | % of events |
A | 6000 | 28% |
Total | 6000 | 28% |
If someone could please help me create that measure, that would be much appreciated. Thank you
Solved! Go to Solution.
Try:
% of events =
DIVIDE(
DISTINCTCOUNT(Event[EventID]),
CALCULATE( DISTINCTCOUNT(Event[EventID] ), ALL(Event[EventID]))
)
Proud to be a Super User!
Paul on Linkedin.
Try:
% of events =
DIVIDE(
DISTINCTCOUNT(Event[EventID]),
CALCULATE( DISTINCTCOUNT(Event[EventID] ), ALL(Event[EventID]))
)
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrown Thanks I tried the dax that you created, except, it still gave me 100% for all the groups even after choosing one of the groups in the slicer but when I removed the last event ID from the dax, it worked, I will still accept your response as the solution 🙂
I was wondering if you could explain the difference between ALL and ALLSELECTED?
% of events =
DIVIDE(
DISTINCTCOUNT(Event[EventID]),
CALCULATE( DISTINCTCOUNT(Event[EventID] ), ALL(Event))
)
Apologies, my mistake. It should have been:
% of events =
DIVIDE(
DISTINCTCOUNT(Event[EventID]),
CALCULATE( DISTINCTCOUNT(Event[EventID] ), ALL( Table [Group] ))
)
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrown should it be "ALL( Event [Group] )" or "ALL(Event)"? Because it works when I don't specifcy a particular column
If ALL(Event) works, go for it!!
Proud to be a Super User!
Paul on Linkedin.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |