The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
This is a detailed ask. Overall, I want the most popular web url, within each grouping, to be shown in a table visual as the web url of a field hover. Within Conditional Formatting of a field, when we turn on web url and open Advanced Controls, I know we can base the field on a web url to be FIRST or LAST. However, I'm looking a way to base it on popularity (i.e. highest value).
To demostrate this request from my business user, I've created some ficticious data about sports, which mirrors my confidential data.
I start with a dataset like this:
Sport | Team | URL | Views |
Baseball | Yankees | https://www.mlb.com/yankees | 20 |
Baseball | Red Sox | https://www.mlb.com/redsox | 30 |
Baseball | Braves | https://www.mlb.com/braves | 10 |
Football | Cowboys | https://www.nfl.com/teams/dallas-cowboys/ | 4 |
Football | Patriots | https://www.nfl.com/teams/new-england-patriots/ | 5 |
Football | Steelers | https://www.nfl.com/teams/pittsburgh-steelers/ | 6 |
Tennis | Djokovic | https://www.atptour.com/en/players/novak-djokovic/d643/overview | 60 |
Tennis | Medvedev | https://www.atptour.com/en/players/daniil-medvedev/mm58/overview | 50 |
Tennis | Zverev | https://www.atptour.com/en/players/alexander-zverev/z355/overview | 40 |
I want to display a table visual like this:
(Important note, on hover of the Sport column items, I want the web url...
+ for Baseball to be https://www.mlb.com/redsox because it has the most views within the Baseball group,
+ for Football to be https://www.nfl.com/teams/pittsburgh-steelers/
+ for Tennis to be https://www.atptour.com/en/players/novak-djokovic/d643/overview
Sport | Sum of Views |
Baseball | 60 |
Football | 15 |
Tennis | 150 |
Can you think of a creative way I can make this happen?
Solved! Go to Solution.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @hnguy71,
Sorry, but your suggestion doesn't give the desired results.
Your coding yields the following (note, your hover for baseball is a url for the yankees):
The goal is to have the hover for baseball to be the url for the Red Sox, because Red Sox has a higher value for Views (Red Sox has 30, while Yankees have 20).
it should. Did you create the calculated column?
@hnguy71I thought I had followed all of your steps (btw, which were very clearly written - thank you for that). Is there a step that I'm missing?
I wish there was an easy way to upload my .pbix file, so you could see what I see.
Hi @jshutters ,
You can create a new calculated column within your table with the following expression:
Faves = CALCULATE(MAXX(INSERT_TABLE, INSERT_TABLE[URL]), FILTER(INSERT_TABLE, INSERT_TABLE[Sport] = EARLIER(INSERT_TABLE[Sport])))
I would then create a measure for total views:
TotalViews := SUM('Table'[Views])
Inside your new table or matrix, you would have the SPORT and the measure, TotalViews. Proceed to the conditional formatting option on the filter pane and select Sport and turn on Web URL:
And select these settings:
After you have applied, the result should look similar to this:
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
121 | |
85 | |
75 | |
55 | |
46 |
User | Count |
---|---|
135 | |
127 | |
78 | |
64 | |
63 |