cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SimonChung_GGGG
Helper III
Helper III

Dynamic Axis by selected percentage range

Hi PB Experts,

The problem is as below:

I want to display Customer sales by % range, the Output line chart will be controled by the Slicer


The PBIX file is prepared PBIX Download 

 

SimonChung_GGGG_1-1594106728232.png

If I select the range 0%-20% (Customer14/ Customer11/ Customer15) will be shown

If I select the range 21%-40% (Customer12/ Customer13/ Customer08) will be shown

 

SimonChung_GGGG_0-1594106704650.png

 

Hope that someone can help, many thanks!

1 ACCEPTED SOLUTION
yingyinr
Community Support
Community Support

Hi @SimonChung_GGGG ,

I just updated your sample pbix file as below, you can get the updated file from this link:

1. Change the formula of calculated table "Axis" as below:

Axis = GENERATESERIES(0, 100, 1)

2. Create a new measure with below formula

Measure = 
VAR _countC =
    CALCULATE ( DISTINCTCOUNT ( 'Sheet1'[CustomerID] ), ALL ( 'Sheet1' ) )
VAR _percent =
    ROUND ( DIVIDE ( 1, _countC ) * [Rank], 2 ) * 100
RETURN
    IF (
        _percent >= MIN ( 'Axis'[Axis] )
            && _percent <= MAX ( 'Axis'[Axis] ),
        SUM ( Sheet1[Sales] ),
        BLANK ()
    )

Dynamic Axis by selected percentage range.JPG

Best Regards

Rena

Community Support Team _ Rena
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
yingyinr
Community Support
Community Support

Hi @SimonChung_GGGG ,

I just updated your sample pbix file as below, you can get the updated file from this link:

1. Change the formula of calculated table "Axis" as below:

Axis = GENERATESERIES(0, 100, 1)

2. Create a new measure with below formula

Measure = 
VAR _countC =
    CALCULATE ( DISTINCTCOUNT ( 'Sheet1'[CustomerID] ), ALL ( 'Sheet1' ) )
VAR _percent =
    ROUND ( DIVIDE ( 1, _countC ) * [Rank], 2 ) * 100
RETURN
    IF (
        _percent >= MIN ( 'Axis'[Axis] )
            && _percent <= MAX ( 'Axis'[Axis] ),
        SUM ( Sheet1[Sales] ),
        BLANK ()
    )

Dynamic Axis by selected percentage range.JPG

Best Regards

Rena

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

Many thanks! It's exactly what I want

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors