Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
This is what happens when I choose a filter.
This is the desirable result when I choose a filter - except it is a column chart, instead of a line chart.
Any help will be very much appreciated 🙂
Korina
Solved! Go to Solution.
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) )
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) )
User | Count |
---|---|
136 | |
70 | |
69 | |
54 | |
52 |
User | Count |
---|---|
207 | |
94 | |
64 | |
61 | |
57 |