Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I came from Tableau and in this i use LOD to classificate
I have this table below and I need to classify each person according to the values obtained in column Classification. For example if the person has the 3 classifications "HIGHER" then he will be "Indicated", if he has up to two "INCREASE" and one "HIGHER" then he will be "INDICATED BUT X" and has other metrics. How can I do this?
Solved! Go to Solution.
you also can create a measure
Column =
var _Classification = SELECTEDVALUE(Table[Classification])
var _higherCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = _Classification )
var _increaseCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = _Classification )
RETURN
SWITCH(TRUE(),
_higherCount = 3, "Indicated",
_increaseCount <= 2 _higherCount = 1, "INDICATED BUT X",
"Other"
)
Hi @joaoresende
try to create a column with technique like this
Column =
var _higherCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = "Higher")
var _increaseCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = "Increase")
RETURN
SWITCH(TRUE(),
_higherCount = 3, "Indicated",
_increaseCount <= 2 _higherCount = 1, "INDICATED BUT X",
"Other"
)
Hello, @az38
Thank you for answer, i was with a problem when i try to use this column. I think is because to get the "classification" i was using the measure bellow :
Measure :
Classification =
var percentil = [meanPercentil]
return
LOOKUPVALUE('Classification'[Classification];'Classification'[Percentil];percentil)
ERROR :
A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
you also can create a measure
Column =
var _Classification = SELECTEDVALUE(Table[Classification])
var _higherCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = _Classification )
var _increaseCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = _Classification )
RETURN
SWITCH(TRUE(),
_higherCount = 3, "Indicated",
_increaseCount <= 2 _higherCount = 1, "INDICATED BUT X",
"Other"
)
Thank you, i will try this.
The problem that i have with measure is to use on X-asis, i can't see in a graphic.
I send you a invite on Linked-In, if u have some time
so,
you nave to re-design your data model as Measure can not be used both in Column expression and as X-axis
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
75 | |
63 | |
62 |
User | Count |
---|---|
143 | |
104 | |
103 | |
82 | |
66 |