Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Good morning
I have 4 columns where I make decisions based on which column has the lowest value. I currently use the Match() function within Excel to do this, however, I am moving into a SQL environment and connecting my new database to PowerBi. How can I replicate the same functionality within Powerbi, in that I can identify which column has the lowest value? The returned value can be the column name or a numerical value.
Any assistance is greatly appreciated.
Allan
Solved! Go to Solution.
Hi @Anonymous ,
I'd suggest to unpivot the columns first as they suggested here:
Solved: Minimum Value across multiple columns - Microsoft Power BI Community
Here a quick example:
Then you unvpivot all columns that you wish to compare with each other to find the minimum value:
You would end up with something like this:
Lastly, create a measure in DAX like below:
ResultMeasure = VAR _minValue = CALCULATE ( MIN ( Table[Value] ), Table[Value] <> 0 ) RETURN CONCATENATEX ( FILTER ( Table, Table[Value] = _minValue ), Table45[Attribute.1], ", " )
And you get the following result:
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hi @Anonymous ,
I'd suggest to unpivot the columns first as they suggested here:
Solved: Minimum Value across multiple columns - Microsoft Power BI Community
Here a quick example:
Then you unvpivot all columns that you wish to compare with each other to find the minimum value:
You would end up with something like this:
Lastly, create a measure in DAX like below:
ResultMeasure = VAR _minValue = CALCULATE ( MIN ( Table[Value] ), Table[Value] <> 0 ) RETURN CONCATENATEX ( FILTER ( Table, Table[Value] = _minValue ), Table45[Attribute.1], ", " )
And you get the following result:
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Thank you so much for the concise answer and it is greatly appreciated. I will build this in and get to work.
Weirdly excited to try this out lol
Cheers
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |