Forum Discussion
Measure returning majority category
SabineOussi add a new column for product category and then a measure and that will do it
Product Category Column =
VAR __cost = 'Table'[Cost]
VAR __sales = 'Table'[Sales]
RETURN
SWITCH ( TRUE(),
__sales >= 200 && __cost <= 5, "CAT1",
__sales >= 100 && __cost <= 10 , "CAT2",
__sales >= 50 && __cost <= 20, "CAT3",
"CAT4"
)
Manufacturer Category =
VAR __m = MAX ( 'Table'[Manufacturer] )
VAR __table =
SUMMARIZE (
FILTER(
ALL ('Table' ),
'Table'[Manufacturer] = __m
),
'Table'[Manufacturer],
[Product Category] ,
"@Cnt", COUNTROWS ('Table' ) )
RETURN
MINX ( TOPN ( 1, __table, [@Cnt], DESC ), [Product Category] )
✨ Follow us on LinkedIn and to our YouTube channel
Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
- SabineOussi4 years agoSkilled Sharer
Thanks parry2k
The measure serves the purpose and results are well aligned.
However when choosing a selection of more than one million records, the visual exceeds the number of available resources. My dataset has ~17M rows and expected to grow double by the end of the year.
Any thoughts?
Thanks,
Sabine O.