Forum Discussion
jabrillo
2 years agoHelper I
Measure as Condition Not Working
I have a table of employees - Emp ID, Emp Name, Dept ID. I created two measures:
- Emp Count = count(Emp ID)
- Count Group = if(Emp Count < 10, "10 and below", "Over 10")
Can I create the table visual below without creating a table:
| Count Group | # of Depts |
| 10 and below | 7 |
| Over 10 | 1 |
Hi,
Here is one way to this:
data:
Dax:Measure 15 = var _vtable =SUMMARIZE('Table (26)','Table (26)'[Department],"ids",COUNT('Table (26)'[ID]))var _over2 = COUNTROWS(FILTER(_vtable,[ids]>=2))var _under2 = COUNTROWS(FILTER(_vtable,[ids]<2))RETURN"2 and over dep: " & _over2 & " under 2 dep: " & _under2
End result:
You can add unichar 10 for linebreak:
Measure 15 = var _vtable =SUMMARIZE('Table (26)','Table (26)'[Department],"ids",COUNT('Table (26)'[ID]))var _over2 = COUNTROWS(FILTER(_vtable,[ids]>=2))var _under2 = COUNTROWS(FILTER(_vtable,[ids]<2))RETURN"2 and over dep: " & _over2 &UNICHAR(10)& " under 2 dep: " & _under2
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
4 Replies
- ValtteriNCommunity Champion
Hi,
Here is one way to this:
data:
Dax:Measure 15 = var _vtable =SUMMARIZE('Table (26)','Table (26)'[Department],"ids",COUNT('Table (26)'[ID]))var _over2 = COUNTROWS(FILTER(_vtable,[ids]>=2))var _under2 = COUNTROWS(FILTER(_vtable,[ids]<2))RETURN"2 and over dep: " & _over2 & " under 2 dep: " & _under2
End result:
You can add unichar 10 for linebreak:
Measure 15 = var _vtable =SUMMARIZE('Table (26)','Table (26)'[Department],"ids",COUNT('Table (26)'[ID]))var _over2 = COUNTROWS(FILTER(_vtable,[ids]>=2))var _under2 = COUNTROWS(FILTER(_vtable,[ids]<2))RETURN"2 and over dep: " & _over2 &UNICHAR(10)& " under 2 dep: " & _under2
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/- jabrilloHelper I
Thank you
- Learner27Helper III
Hope it helps
GROUP BY Count Group = SWITCH(TRUE(),
[# of Depts] <= 10, "10 and below",
[# of Depts] > 10, "Over 10"
)
If i understand your requiement correctly
- jabrilloHelper I
Thank you