Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a table with 3 columns. I need to output the min cost for product by scenario and lowest cost product.
I have tried MINX and Grouping but I am unable to get all I need
This will give you the minimum cost for each scenario. Is that what you are asking for?
Min Cost By Product and Scenario = CALCULATE( MIN('DataTable'[Total Cost]), ALL('DataTable'[Product]) )
Lowest product cost overall would be:
Lowest Cost = CALCULATE( MIN('DataTable'[Total Cost]), ALL('DataTable') )
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThanks!!
This is what I need yes but the last part would be to filter so that only the lowest combinations
Add this measure
Lowest Cost Filter = (MAX('DataTable'[Total Cost]) = [Min Cost By Product and Scenario]) * 1
Then add that measure to a filter and set it to only show when it is 1. If it is zero, then it isn't the lowest cost for that Scenario/Product combo. You have to multiply by 1 to convert True/False to 1/0 so it will be filterable.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingFor me this does not work becuase
[Min Cost By Product and Scenario]
is not a measure but a column.
A column how? A calculated column? It should be a measure. A column from Power Query? Why would you bring this data in this way as it won't recalculate as you filter/slice/add different contexts to a matrix.
It should be the measure I posted unless there is a really good reason to make it a column
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingUser | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |