Forum Discussion
Sdelpino
3 years agoRegular Visitor
Dinamic mesure as category
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 us...
- 3 years ago
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 )
Jihwan_Kim
Super User
3 years agoHi,
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 )