Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
edavilaamerivet
Frequent Visitor

Help with top 50 products by location

Good day community

 

I was hoping to see if there's someone who can help me as I can figure out how to make this work.

 

I need to have a visual were each of my locations can show the top 50 revenue codes by type of service

 

Example

 

Location 1

Service top 50 

Inventory top 50

diagnostic top 50

 

if this something that can be done 

Transaction Table

 

the total amount for the revenue

total qty for the qty (for use of top 50)

 

Code Table

 

codes [code] for the number of SKU

standarizedcodetype is for the group

 

Thank you

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @edavilaamerivet 

Based on your description, I create data to reproduce the scenario.

Transcation:

x1.png

Table:

x4.png

You may go to ‘Modeling’ area and create a what if Parameter.

x2.png

 

You can create a measure as follows.

rank =

IF (

    RANKX (

        SUMMARIZE (

            FILTER (

                ALLSELECTED ( 'Transcation' ),

                RELATED ( 'Table'[codetype] ) IN FILTERS ( 'Table'[codetype] )

            ),

            Transcation[Location],

            'Table'[codetype],

            "total", SUM ( Transcation[Revenue] )

        ),

        [total],

        CALCULATE ( SUM ( Transcation[Revenue] ) ),

        DESC,

        DENSE

    ) <= [TOPN Value],

    SUM ( Transcation[Revenue] ),

    BLANK ()

)

 

Result:

x3.png

If I misunderstand your thought, please show me your sample data and expected result. Do mask sensitive data before uploading. I am glad to solve the problem for you.

 

Best Regards,

Allan

 

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

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @edavilaamerivet 

Based on your description, I create data to reproduce the scenario.

Transcation:

x1.png

Table:

x4.png

You may go to ‘Modeling’ area and create a what if Parameter.

x2.png

 

You can create a measure as follows.

rank =

IF (

    RANKX (

        SUMMARIZE (

            FILTER (

                ALLSELECTED ( 'Transcation' ),

                RELATED ( 'Table'[codetype] ) IN FILTERS ( 'Table'[codetype] )

            ),

            Transcation[Location],

            'Table'[codetype],

            "total", SUM ( Transcation[Revenue] )

        ),

        [total],

        CALCULATE ( SUM ( Transcation[Revenue] ) ),

        DESC,

        DENSE

    ) <= [TOPN Value],

    SUM ( Transcation[Revenue] ),

    BLANK ()

)

 

Result:

x3.png

If I misunderstand your thought, please show me your sample data and expected result. Do mask sensitive data before uploading. I am glad to solve the problem for you.

 

Best Regards,

Allan

 

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

Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


Follow on LinkedIn
@ 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...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.