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
NiugeS
Helper V
Helper V

Rank Column then Calculate Running Percentage and Text

Hi all,

 

I'm still working my way through PowerBI and i'm stumped.  I've created the below, which to my amazement, works.  It's a list of teams and the total they have paid.  I have then created two additional columns % of Total Sales and % of Location Sales.

Screenshot_10.jpg

 

I am now trying to find a way to rank the % of Location Sales Amount Largest to Smallest and calculate a running total.  Once I have the running total, I want to add a column that specifies what Tier the team is in.

 

Tier Info:

Tier 1 <= 25%
Tier 2 >25% <= 50%
Tier 3 > 50% <=75%
Tier 4 > 75%

 

Example below (filtered to Canada), the teams are put in order from highest to lowest spend based on % of location Sales Amount, a running total of location % is calculated and based on this figure, the Tier information is provided.

Tier.jpg

 

I have attached my test pbix file for reference. Test Pbix 

Any guidance or suggestions would be greatly appreciated.

Many thanks...

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur Thank you for the help.  I'll try and have a look later this evening.

mahoneypat
Employee
Employee

Here is a measure expression that gets your desired result.

 

Tier =
VAR vThisTeam =
    MIN ( 'Table'[Team] )
VAR vSummary =
    ADDCOLUMNS (
        ALLSELECTED ( 'Table'[Team] ),
        "cTotal", [% of Location Sales Amount]
    )
VAR vThisTotal = [% of Location Sales Amount]
VAR vRT =
    SUMX (
        FILTER (
            vSummary,
            [cTotal] >= vThisTotal
        ),
        [cTotal]
    )
RETURN
    SWITCH (
        TRUE (),
        vRT <= 0.25"Tier 1",
        vRT <= 0.50"Tier 2",
        vRT <= 0.75"Tier 3",
        "Tier 4"
    )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you @mahoneypat - will be reviewing tonight.  Greatly appreciate the help.

NiugeS
Helper V
Helper V

@mahoneypat  Hi - i tried to edit it before anyone viewed but you were too quick!  I've uploaded the correct one.  Thank you.

mahoneypat
Employee
Employee

I think you attached a different pbix file.

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.