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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.