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])
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)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.
- Greg_Deckler8 years agoCommunity Champion
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.
- prill2ta7 years agoAdvocate II
Hey Greg!
I am having this exact same issue.. Would you be willing to assist me with this?Thank you!