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
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!