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
mehlenbae2
Helper II
Helper II

Measure to get total of all text values and using Top N

Hi,

I am have two pie charts that I want to show Top Businesses and Top Locations. There are so many locations and businesses I need to knock what is shown in the visualization to Top 5, which I can do by using the Top N PowerBI feature. However, the totals change when I use the Top N feature.

 

I need to create a measure that gives me my Top 5 Locations using the Top N feature but still is calculating the total of the entire column.

 

How can I do this?

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

You can use a measure like this to force the total row to calculate the full amount.

 

Amount Full Total =
IF (
    NOT HASONEVALUE ( Companies[Company Name] ) && NOT HASONEVALUE ( Companies[Location] ),
    CALCULATE ( [Sales Amount], ALL ( Companies ) ),
    [Sales Amount]
)

jdbuchanan71_0-1667578213412.png

 

 

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

You can use a measure like this to force the total row to calculate the full amount.

 

Amount Full Total =
IF (
    NOT HASONEVALUE ( Companies[Company Name] ) && NOT HASONEVALUE ( Companies[Location] ),
    CALCULATE ( [Sales Amount], ALL ( Companies ) ),
    [Sales Amount]
)

jdbuchanan71_0-1667578213412.png

 

 

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.