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
Shivakumar_S_D
New Member

How to store top n brands as a measure so that it can be used in line chart?

I am creating a Top N Ranking report using DAX, the user can select the number of top n brands to be displayed and a table visual gets altered according to the number selected. Now on the other page, I need the same brands to be displayed as a trendline chart so they can see all the historical data regarding those brands.

 

I used the same DAX measure to extract the top n brands but that measure cannot be used in the line chart as a legend.

Also tried to create a dynamic table which can store these brands and changes according to the filter selection, but found out that it is not possible in power bi to create a dynamic table in power bi.

 

Thanks in advance

 

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Shivakumar_S_D Yes, you are correct in all of this. Measures cannot return tables of data, only scalar values. I have harped on this for a long time that I wish Microsoft would allow measures to return tables. Also, yes, you cannot use measures as an x-axis, for that you need the disconnected table trick. But, not dynamic. How is the user selecting the number of top n brands to be displayed? If it is via a slicer or something, perhaps you can use Sync Slicers to ensure that the trendline chart is updated in coordination with the first page?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler, Thank you for clarifying the doubt, I have already tried syncing the slicers, but that doesn't help since the first page tables are based on a measure and the line chart is based on a column from a different table

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.