cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MisterFry Frequent Visitor
Frequent Visitor

Chart by rank of measure

Hey All,

 

What I want is to rank products based on a sales metric, and display that metric, sorted ascending by rank on a continuous axis. 

 

The catch is that the fact table is at a lower intersectionality than my desired summary, and I need that summary to be reactive to selections made in slicers in the interface. 

 

More practically, I have a table of Sales. Sales are associated to stores, products, and a calendar (by weeks).

I want to chart, by Product 

The RANK of:

Productivity = CALCULATE(SUM(Sales)/DISTICTCOUNT(Stores), 'Product'[SomeFlag] = "Something")  along the X (horizontal) axis

and 

Productivity = CALCULATE(SUM(Sales)/DISTICTCOUNT(Stores), 'Product'[SomeFlag] = "Something")  along the Y 

 

I've managed to achieve this by creating a table: 

Productivity =
SUMMARIZE('Fact Data'
,'Fact Data'[Product.ID]
,"Avg Sales per Store", DIVIDE([Sum Tot Sls Rtl],[Store Count])
)
and then creating a calculated column 
Avg Sales Rank = RANKX('Productivity', 'Productivity'[Avg Sales per Store])
 
What it does NOT do, which I need it to, is recalculate the summarized data based on the filter context applied to the fact table. I feel like this should be a relatively simple thing to do... but I can't seem to figure it out. 
 
Bonus points if you can help me make it display a line for more than one week. 
 
Thanks!
-R
1 ACCEPTED SOLUTION

Accepted Solutions
MisterFry Frequent Visitor
Frequent Visitor

Re: Chart by rank of measure

Unfortunately, I'm not able to share my data, or a subset of my data. 

 

I wrote my visualization in R instead. 

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Chart by rank of measure

Hi MiserFry

 

It is hard to understand the measure without sample data, so if possible, could you please inform me more detailed information(such as your fact  table and product table)? And if you want to sort chart by measure or column’s result, you could try to use below step:

73.png

Best Regards,

Zoe Zhi

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

MisterFry Frequent Visitor
Frequent Visitor

Re: Chart by rank of measure

Unfortunately, I'm not able to share my data, or a subset of my data. 

 

I wrote my visualization in R instead. 

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 215 members 2,171 guests
Please welcome our newest community members: