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])
Thank you so much, that's brilliant :)
When i'm creating the table, is it possible to add a filter inso that it only calculates the score where, say, the Visits column is > 5?
Sure can:
Table = FILTER(SUMMARIZE('TABLE','TABLE'[Column],"MyMeasure",[Measure]),<filter expression>)Is "Visits" your equivalent of "MyMeasure"?
If so, then it would be:
Table = FILTER(SUMMARIZE('TABLE','TABLE'[Column],"MyMeasure",[Measure]),[MyMeasure]=5)- kohlivinayak8 years agoResolver I
Hi Greg_Deckler
I have the same issue only difference is my filter will be selected by user from a slicer. How to do this now ?
- Greg_Deckler8 years agoCommunity Champion
Well, there you are going to run into a problem. Tables are not dynamic based upon user input, they get calculated at the time of query refresh. I will provide the how, if it was not a table, but a measure below but perhaps we need to backup and truly understand your data and what you are trying to accomplish.
Measure = VAR __SelectedValue = MAX('SlicerTable'[SlicerColumn] VAR __tmpTable = FILTER(SUMMARIZE('TABLE','TABLE'[Column],"MyMeasure",[Measure]),[MyMeasure]=__SelectedValue) ...<something> RETURN <something>So basically, you are grabbing the selected value from the slicer and using it in your filter clause. But, you have to do some additional calculations/manipulation to return a single value from a measure.
- kohlivinayak8 years agoResolver I
Hi Greg_Deckler
Thanks for the reply
I have posted my query here
https://community.powerbi.com/t5/Desktop/Dynamic-Grouping-on-Sum/m-p/454924#M210785
I will try your measure and will update here.