Forum Discussion
Fixed line in line graph
Hi peeps
I have a link graph which is affected by an array of slicers however I do not want one of the lines to be changed when slicers are changes. My example is in the below. I want the "DPS Average" to not change but the others to change - HELP!
Hi Anonymous ,
In your fomula below, you add a extra symbol "{", it caused the error.
Additonally, you should use the allexcept function, otherwise the fixed line value is the same for each date.
If the Axis of the line chart is [Date], modify the formula like this:
Fixed Line = CALCULATE ( [DSP Average], ALLEXCEPT ( 'Unscheduled Leave', 'Unscheduled Leave'[Date] ) )Get the correct result in my sample.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
13 Replies
- amitchandakSuper User
Anonymous . Create a line on a measure like
calculate([Measure], all() )
This will ignore all the filter
- AnonymousNot applicable
Thankyou I tried this one and still fails - see error message below
- amitchandakSuper User
Anonymous , parenthesis after calculate are two, there should be one
calculate([DPS Average], all() )
or
calculate([DPS Average], all('Unscheduled Leave') )
- v-yanjiang-msftCommunity Support
Hi Anonymous ,
In your fomula below, you add a extra symbol "{", it caused the error.
Additonally, you should use the allexcept function, otherwise the fixed line value is the same for each date.
If the Axis of the line chart is [Date], modify the formula like this:
Fixed Line = CALCULATE ( [DSP Average], ALLEXCEPT ( 'Unscheduled Leave', 'Unscheduled Leave'[Date] ) )Get the correct result in my sample.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Unfortunately this still isnt working 😞 I have duplicated the meausre as one measure needs to capture all (with as you mentioned above the parenthesis) and one that is affected by the slicer but it picks up for both
My measure is
Average Days Per FTE - rolling 12 Months =VAR STARTDATE =CALCULATE ( STARTOFMONTH('Unscheduled Leave'[Cal. year / month]) )RETURNCALCULATE (DIVIDE ( SUM ( 'Unscheduled Leave'[Actual Days]), SUM ( 'Employee Master'[FTE - Operational] ) ),DATESINPERIOD ( 'Report Date'[Date], STARTDATE, -12, MONTH))*12- v-yanjiang-msftCommunity Support
Hi Anonymous ,
Sorry I'm not very clear "one measure needs to capture all" and "one that is affected by the slicer but it picks up for both".
In your original post, you want the "DPS Average" to not change but the others to change, so when you replace the DPS Average with the Fixed Line, what happend? Does it still change by the slicer?
Best Regards,
Community Support Team _ kalyj- AnonymousNot applicable
So what I mean is that I have three slicers - Division, Branch Section. I have the same formula for two meausres. One i want all Division, Branch section to be fixed and not changed. But my slicers (Division, Branch and Section) change the other measure. Does that make sense?
- AnonymousNot applicable
Apologies if I was not clear.
The measure I have above is the one I have duplicated. So Ill have both in the same graph but for one measure I want it to be affected (area) by the slicers and the other I do not want it to be affected. So when I use the Calculate[DPS Average] all()) for one measure it still is affected by the slicers.
- v-yanjiang-msftCommunity Support
Hi Anonymous ,
Sorry for the late back. How about using different measures separately, not to duplicate it. One using the original measure and another using the Fixed Line.
Best Regards,
Community Support Team _ kalyj- AnonymousNot applicable
Thanks Kalyj - unfortunately still doesnt work. Not duplicating the measure but duplicating the code for the measure but then creating a measure based on the code you have supplied.
So to explain I have the main measure of
Average Days Per FTE - rolling 12 Months =VAR STARTDATE =CALCULATE ( STARTOFMONTH('Unscheduled Leave'[Cal. year / month]) )RETURNCALCULATE (DIVIDE ( SUM ( 'Unscheduled Leave'[Actual Days]), SUM ( 'Employee Master'[FTE - Operational] ) ),DATESINPERIOD ( 'Report Date'[Date], STARTDATE, -12, MONTH))*12Then I have duplicated this code for DPS Average. But to get DPS average I used your codeDPS Average = CALCULATE ([DPS Average Days Per FTE - Measure],ALLEXCEPT ( 'Report Date', 'Report Date'[Date] )).Unfortunately any time you change the slicers it changes everything