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

Slicer to show customers that make up X% of Total Sales

https://community.powerbi.com/t5/Desktop/Show-items-that-make-up-x-of-the-sales/m-p/645622

 

Good afternoon - I have been attempting to model my solution with the above link, but am having issues (most likely myself)
I am looking to have a slicer that I can use to display the customers that make up X% of the sales (not the # of customers) for the time period.  Could anyone be of assistance?

 

Thanks

1 ACCEPTED SOLUTION

Hi @jbr9999,

You can create a table visual use company as category group and value with aggregate mode 'sum'.
You can create a ‘what if’ parameter table with 1 to 100 , a ‘type’ table with top and bottom. Then you can write a measure formula to compare selections and table visual records and use on 'visual level filter' to filter records.

formula =
VAR summary =
    SUMMARIZE ( ALLSELECTED ( Table ), [Company], "Amount", SUM ( Table[Amount] ) )
VAR selected =
    MAX ( ParaTable[Value] )
VAR fRate =
    selected / 100
        * SUMX ( summary, [Amount] )
VAR fType =
    SELECTEDVALUE ( TypeTable[Type] ) //top, Bottem
VAR filtered =
    FILTER ( summary, IF ( fType = "Top", [Amount] <= fRate, [Amount] >= fRate ) )
VAR currCompany =
    SELECTEDVALUE ( RawTable[Company] )
RETURN
    IF ( currCompany IN SELECTCOLUMNS ( filtered, "Company", [Company] ), "Y", "N" )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
jbr9999
New Member

Thank you for the response.

Effectively I want to be able to display the customers that make up a % of sales.

jbr9999_0-1670339188285.png


Thank you



Hi @jbr9999,

You can create a table visual use company as category group and value with aggregate mode 'sum'.
You can create a ‘what if’ parameter table with 1 to 100 , a ‘type’ table with top and bottom. Then you can write a measure formula to compare selections and table visual records and use on 'visual level filter' to filter records.

formula =
VAR summary =
    SUMMARIZE ( ALLSELECTED ( Table ), [Company], "Amount", SUM ( Table[Amount] ) )
VAR selected =
    MAX ( ParaTable[Value] )
VAR fRate =
    selected / 100
        * SUMX ( summary, [Amount] )
VAR fType =
    SELECTEDVALUE ( TypeTable[Type] ) //top, Bottem
VAR filtered =
    FILTER ( summary, IF ( fType = "Top", [Amount] <= fRate, [Amount] >= fRate ) )
VAR currCompany =
    SELECTEDVALUE ( RawTable[Company] )
RETURN
    IF ( currCompany IN SELECTCOLUMNS ( filtered, "Company", [Company] ), "Y", "N" )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @jbr9999,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.

Top Solution Authors