A recent question came out of the Enterprise DNA Support Forum where a member needed to work out what was the top value that they had for a particular result.
You can review the entire forum post here – Product Name as Measure for Highest Sales Product
They didn’t require just any value. They actually wanted the name of the top result, requiring text to be the result showing in a card visualisation.
I felt like this was a good example to branch out into a tutorial which shows you how to combine a few key functions inside of DAX to extract this type of result.
One of the key functions to go into here is SELECTEDVALUE. What this enables you to do is extract text results inside of Power BI and showcase them in your reports in some way, shape, or form.
What we need to do is calculate a text value but we also at the same time, need to change the context in which we calculate it.
We only want to show the top result with this solution. To be able to complete any internal ranking and also change the context of a calculation we need to utilize the TOPN function.
We utilize a combination of CALCULATE, SELECTEDVALUE, and TOPN to extract this result and put it into a card visualisation inside of our Power BI report.
Quite a unique concept but a really useful one. Hopefully, you can see how to extract many other types of text results into cards just by changing around what filtering dynamics you have inside of the CALCULATE function.
For a number of other ranking concepts for Power BI check out these relevant tutorials below.
Enjoy working through this video.
***** Learning Power BI? *****
FREE COURSE – Ultimate Beginners Guide To Power BI
FREE COURSE – Ultimate Beginners Guide To DAX
FREE – 60 Page DAX Reference Guide Download
FREE – Power BI Resources
Enterprise DNA Membership
Enterprise DNA Online
Enterprise DNA Events
***** Related Links*****
***** Related Course Modules*****
***** Related Support Forum Posts*****