Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
joaoresende
Frequent Visitor

Count different values and give a classification (LOD in power BI)

 

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?

 

powerbi.png

 
1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@joaoresende 

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"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

5 REPLIES 5
az38
Community Champion
Community Champion

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"
)

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.

 

az38
Community Champion
Community Champion

@joaoresende 

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"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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

az38
Community Champion
Community Champion

@joaoresende 

so,

you nave to re-design your data model as Measure can not be used both in Column expression and as X-axis


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors