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
corporate
Helper I
Helper I

Hide lines in stacked line chart

Hi everyone,

 

I had to create a line chart as an user asked in this post: https://community.powerbi.com/t5/Desktop/Line-Chart-With-Values-As-a/td-p/199703 and it worked. Here is my chart:

 

line.png

 

What I need to do now, is to create a filter for the Category in my chart (Age Range) that doesn't affect the values in the chart, but simply hides the lines (all other filters should work as usual).

 

For example, when I select Age 18-40, the chart adjusts its values and displays a single line with value 1 (100%),

line.png

 

But I don't want adjusted values, I need the same line of the previuos chart, as if all the other lines have been simply hidden.

 

Can you help me?

 

Thank you!

1 ACCEPTED SOLUTION

@corporate 

 

Try this

 

Production Age =
DIVIDE (
    SUM ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[PRODUCTION] ),
    CALCULATE (
        SUM ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[PRODUCTION] ),
        ALL ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[Age Range] )
    )
)

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

View solution in original post

4 REPLIES 4
nandukrishnavs
Super User
Super User

@corporate - Could you share the pbix file/sample tables and existing measure logic. 


Regards,
Nandu Krishna

Hi @nandukrishnavs , unfortunately with my account I can't share the pbix file, but here is an example of my table:

MonthTargetRegionAge RangeProduction
201912DomesticoLombardia18 - 4010
201912DomesticoLombardia40 - 5015
201912Micro BusinessLombardia18 - 4020
202001DomesticoLombardia18 - 405
202001DomesticoPiemonte18 - 407
202001Micro BusinessPiemonte18 - 4015
202001Micro BusinessPiemonte40 - 5020
202002DomesticoLombardia18 - 4015
202002DomesticoLombardia50 - 6020
202002DomesticoPiemonte40 - 504
202002Micro BusinessPiemonte50 - 6012
202002Micro BusinessLombardia18 - 4016

 

and this is the measure I created and used as Values in line chart:

 

 

Production Age = 
DIVIDE (
    SUM ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[PRODUCTION] ),
    CALCULATE ( SUM ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[PRODUCTION] ), ALLSELECTED ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[AGE_RANGE] )))

 

 

line.png Thank you!

@corporate 

 

Try this

 

Production Age =
DIVIDE (
    SUM ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[PRODUCTION] ),
    CALCULATE (
        SUM ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[PRODUCTION] ),
        ALL ( 'ANALYSIS AQ_MONITORING_DEEPDIVE'[Age Range] )
    )
)

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

It works! Thank you very much!

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.