The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi ,
I am trying to get the min value of one dimension based on selecting another value of that dimension through a common dimension.
e.g. I have simple table with date, car, colour and amount. The car can have multiple colours. Green is the cheapest. I select red in a filter so I can display the cost of red in one visual, but I also want to see the cheapest for comparision.
My approach is get the car first of the selected colour, then get the list of all colours associated with that car, then get try to get the value of those colours however but this is just returning min value of the selected colour.
Solved! Go to Solution.
You can create a measure like
Cheapest colour =
var summaryTable = CALCULATETABLE( SUMMARIZE('Table', 'Table'[Car], 'Table'[Colour], 'Table'[Amount]), REMOVEFILTERS('Table'[Colour]))
var cheapestColours = TOPN(1, summaryTable, [Amount], ASC)
return CONCATENATEX( cheapestColours, [Colour], ", ")
The CONCATENATEX is in case there are multiple colours at the same price
You can create a measure like
Cheapest colour =
var summaryTable = CALCULATETABLE( SUMMARIZE('Table', 'Table'[Car], 'Table'[Colour], 'Table'[Amount]), REMOVEFILTERS('Table'[Colour]))
var cheapestColours = TOPN(1, summaryTable, [Amount], ASC)
return CONCATENATEX( cheapestColours, [Colour], ", ")
The CONCATENATEX is in case there are multiple colours at the same price
thanks @johnt75 that looks like its working as expected...now to apply to my actual complicated dataset!
User | Count |
---|---|
64 | |
55 | |
54 | |
51 | |
31 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
45 |