Forum Discussion
IvanMislav
Helper I
7 years agoDynamic label based on custom measure
Hi, i have a simple data model. Something like company name, income, expenses. I created a custom measure Balance = income - expenses. What I want to do is create a dynamic lable: if bala...
Greg_Deckler
Community Champion
7 years agoYou could do this:
Label =
SWITCH(TRUE(),
[Balance]<0,"negative",
[Balance]>0,"positive",
"zero"
)
NegativeCount =
VAR __table = SUMMARIZECOLUMNS('Table19'[Company],'table19',"__balance",[Balance])
RETURN
COUNTX(FILTER(__table,[__balance]<0),[Company])
See attached Table 19, Page 11
- IvanMislav7 years ago
Helper I
Hi, Greg!
Thank you for your answer. I can't find the attached table.
- Greg_Deckler7 years ago
Community Champion
Whoops, forgot to attach.
- IvanMislav7 years ago
Helper I
Thanks, I can see the file now.
This works when there are unique values for companies. In my table company name values are not unique.