Hi Comunity, hope you can help me with this challenge,
Given the data set in the "Dataset" below, I need a measure that can calculate the number of members who attended more than one event as the user chooses the events, and that measure can be used as a category to count the number of members who attended. For example, if the user select the events CALL CONV MITING PARTY events, I need to make a pie chart in the image.
Members | Event |
A | PARTY |
A | MITING |
B | MITING |
D | MITING |
F | MITING |
A | CONV |
B | CONV |
C | CONV |
A | CALL |
D | CALL |
C | CALL |
F | CALL |
F | PARTY |
C | PARTY |
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
One of ways is to create a supporting table like below.
Expected result measure: =
VAR _attendcount =
MAX ( Attended[Attended] )
VAR _eventscountbymembers =
ADDCOLUMNS (
DISTINCT ( Data[Members] ),
"@eventscount", CALCULATE ( COUNTROWS ( DISTINCT ( Data[Event] ) ) )
)
VAR _filtertable =
FILTER ( _eventscountbymembers, [@eventscount] = _attendcount )
VAR _allmembers =
COUNTROWS ( DISTINCT ( Data[Members] ) )
RETURN
DIVIDE ( COUNTROWS ( _filtertable ), _allmembers )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
This works perfect!!!
Thanks!!
Hi,
Please check the below picture and the attached pbix file.
One of ways is to create a supporting table like below.
Expected result measure: =
VAR _attendcount =
MAX ( Attended[Attended] )
VAR _eventscountbymembers =
ADDCOLUMNS (
DISTINCT ( Data[Members] ),
"@eventscount", CALCULATE ( COUNTROWS ( DISTINCT ( Data[Event] ) ) )
)
VAR _filtertable =
FILTER ( _eventscountbymembers, [@eventscount] = _attendcount )
VAR _allmembers =
COUNTROWS ( DISTINCT ( Data[Members] ) )
RETURN
DIVIDE ( COUNTROWS ( _filtertable ), _allmembers )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
User | Count |
---|---|
202 | |
80 | |
79 | |
76 | |
44 |
User | Count |
---|---|
167 | |
86 | |
80 | |
79 | |
74 |