Forum Discussion
Grouping values from measures
- 8 years ago
You should be able to do it like this:
Table = SUMMARIZE('TABLE','TABLE'[Column],"MyMeasure",[Measure])
OK, based on the data in the other post, I created a Category table with:
Category
| 0-50 percent |
| 51-75 percent |
| 75-100 percent |
And a measure like this:
Measure =
VAR __Date = MAX('Table'[date])
VAR __Category = MAX('Categories'[Category])
VAR __Low =
SWITCH(
__Category,
"0-50 percent",0,
"51-75 percent",.51,
"75-100 percent",.75
)
VAR __High =
SWITCH(
__Category,
"0-50 percent",.5,
"51-75 percent",.74,
"75-100 percent",1
)
VAR __tmpTable = SUMMARIZE('Table','Table'[userid],"__Percent",MAX('Table'[profilepercent]))
RETURN COUNTROWS(FILTER(__tmpTable,[__Percent]>=__Low && [__Percent]<=__High))PBIX is attached.
Greg_Deckler
This solution is fantastic.
I have a question though. This will allow incoming filters to change the output, but since it's the result of a temp table calculation what do I need to do to allow filters to be passed back out of a widget that is using the grouped up values? If I click on one of the groups in the widget using this formula, nothing else on the page gets filtered by the selection. Is there somehow a way to define a relationship back out, say...using the ID(s) that are contained in the selected group?
Attached image: Red box is using the grouping formula but the yellow boxed widgets are not being filtered by the selection in the red box. All widgets share a common unique identifier of PropertyID, which is included in the summarized data in the formula but cannot be filtered back out.