Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jshutters
Resolver I
Resolver I

How to base the order of web urls by value?

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:

SportTeamURLViews
BaseballYankees https://www.mlb.com/yankees20
BaseballRed Soxhttps://www.mlb.com/redsox30
BaseballBraveshttps://www.mlb.com/braves10
FootballCowboyshttps://www.nfl.com/teams/dallas-cowboys/4
FootballPatriotshttps://www.nfl.com/teams/new-england-patriots/5
FootballSteelershttps://www.nfl.com/teams/pittsburgh-steelers/6
TennisDjokovichttps://www.atptour.com/en/players/novak-djokovic/d643/overview60
TennisMedvedevhttps://www.atptour.com/en/players/daniil-medvedev/mm58/overview50
TennisZverevhttps://www.atptour.com/en/players/alexander-zverev/z355/overview40

 

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

SportSum of Views
Baseball60
Football15
Tennis150

 

Can you think of a creative way I can make this happen?

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1643246171685.png

 


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!

View solution in original post

5 REPLIES 5
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1643246171685.png

 


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!

jshutters
Resolver I
Resolver I

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):

jshutters_0-1643235665344.png

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).

@jshutters ,

 

it should. Did you create the calculated column?

hnguy71_0-1643236239961.png

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

@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?

jshutters_0-1643236917910.png

jshutters_1-1643237023916.png

I wish there was an easy way to upload my .pbix file, so you could see what I see.

 

hnguy71
Memorable Member
Memorable Member

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:

hnguy71_0-1643233172912.png

 

And select these settings:

hnguy71_1-1643233197591.png

After you have applied, the result should look similar to this:

hnguy71_2-1643233228719.png

 

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.