Forum Discussion
RichardP
8 years agoHelper I
Grouping values from measures
Hi, I have a table that looks something like this: AccountID UserID Visits Help requests abc 111 5 0 abc 456 0 1 abc 789 15 2 def 555 2 2 def 666 0 1 ...
- 8 years ago
You should be able to do it like this:
Table = SUMMARIZE('TABLE','TABLE'[Column],"MyMeasure",[Measure])
Greg_Deckler
8 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.
TaariqHussain
3 years agoHelper I
Hope you well
I tried using the above formula, please see below, need some assistance or maybe an alternative
I have 2 tables items sales and a second that has cost
both linked to master inventory
I have a measure that calculates my GP% however i want to group my GP's as per below
thats where your formula came in
Measure =
VAR __Date = MAX('ItemWiseSales'[dateinvoiced])
VAR __Category = MAX('Category'[Category])
VAR __Low =
SWITCH(
__Category,
"Less than 1%",-0.2,
"1%",0.01,
"2%",0.02,
"3-5%",0.03,
"5%>",0.05
)
VAR __High =
SWITCH(
__Category,
"Less than 1%",0.01,
"1%",0.019,
"2%",0.029,
"3-5%",0.049,
"5%>",0.2
)
VAR __tmpTable = SUMMARIZE('ItemWiseSales',ItemWiseSales[itemprice],"__Percent",[GP%])
RETURN COUNTROWS(FILTER(__tmpTable,[__Percent]>=__Low && [__Percent]<=__High))
i than pull that measure into a pie chart but the visual is completely off