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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
korina
Helper I
Helper I

100% Stacked Line Chart responding to slicers/filters

Hello everyone,

 

I am trying to create a 100% stacked line chart, but I need the calculations to respond to some slicers I have in place. Everything works perfectly when I change the graph type to 100% stacked column chart, so there must be a way to convert it to a line chart, but I am not experienced with DAX, and not sure how I can achieve that.

 

Here is the link to all my work:

https://www.dropbox.com/s/d7mefa9qrvr5wh2/100%25%20Stacked%20Line%20Graph.pbix?dl=0

 

Please also see some pictures below, for reference:

 

This is the graph that I have managed to create, and works perfectly without filters.

Capture.PNG

 

 

This is what happens when I choose a filter.

Capture1.PNG

 

This is the desirable result when I choose a filter - except it is a column chart, instead of a line chart.

Capture2.PNG

 

Any help will be very much appreciated 🙂

Korina

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

I've had a shot at it.

 

Please test against your own data

Employees100% = VAR _gender = SELECTEDVALUE(Headcount[Gender])
VAR _thisGenderVal = [Employees%]
VAR _otherGenderVal = CALCULATE([Employees%], Headcount[Gender] <> _gender)
RETURN
    DIVIDE(_thisGenderVal , (_thisGenderVal + _otherGenderVal) )

View solution in original post

2 REPLIES 2
korina
Helper I
Helper I

Thank you so much @HotChilli, it seems to be working perfectly 🙂

HotChilli
Super User
Super User

I've had a shot at it.

 

Please test against your own data

Employees100% = VAR _gender = SELECTEDVALUE(Headcount[Gender])
VAR _thisGenderVal = [Employees%]
VAR _otherGenderVal = CALCULATE([Employees%], Headcount[Gender] <> _gender)
RETURN
    DIVIDE(_thisGenderVal , (_thisGenderVal + _otherGenderVal) )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.