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
niteshtrehan89
Helper III
Helper III

Urgent Help - Top N analyses with Legends

Hi team,

 

I need a urgent dax changes for the TOP N analysis using the legend. if i am not putting the legend in the stacked bar chart then it is working fine but as soon as I put the legend the the TOP N is not working as expected . Legend name is Product.

niteshtrehan89_0-1638685336367.png

 

Below is the dax function, 

TopN Exporter =
VAR SelectedTop = SELECTEDVALUE('Top'[Top])
RETURN
SWITCH(TRUE(),
SelectedTop = 0, [Total Quantity],
RANKX (
ALLSELECTED(MasterData[Exporter Name]),
[Total Quantity]
)
<= SelectedTop,
[Total Quantity]
)
 
Please help me out asap on the requirement.
1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

As @TomMartens says, your request is not very clear.

If you are looking to show values based on a slicer selection for TopN values, this thread might help:

https://community.powerbi.com/t5/Desktop/Instead-Top-N-records-show-inbetween-N-to-N/m-p/2217390#M80... 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

As @TomMartens says, your request is not very clear.

If you are looking to show values based on a slicer selection for TopN values, this thread might help:

https://community.powerbi.com/t5/Desktop/Instead-Top-N-records-show-inbetween-N-to-N/m-p/2217390#M80... 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






TomMartens
Super User
Super User

Hey @niteshtrehan89 ,

 

I have to admit that I do not understand what you are looking for.

If you need urgent help (be aware that most of us are here in our spare time), take the time and create a pbix file that contains sample data but still represents your data model (tables, relationships, calculated columns, and measures). Upload the file to onedrive or dropbox and share the link. If you are using Excel to create the sample data share the Excel as well.

Do not forget to explain the expected result based on the sample data you provided.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.