Forum Discussion

MDSNU's avatar
MDSNU
New Member
4 years ago
Solved

Line graph starting at 100% and still fixed when using data filter (DAX Measure)

Hello Everyone,

 

I need some help with DAX!

 

What I want is to have a fixed value on the Y-Axis and it needs to be still fixed when i'm filtering data, like the example bellow.

 

 

But when i filter the data to the next month, the value doesnt keep at 100%, it changes to their real value, as the other example bellow:

 

I tried a lot of DAX Measures, but i still cant do it! Could you guys please help me? 😅

 

 

  • Hi MDSNU 

     

    You can create a measure to replace the current value field in the line chart. In this measure, it needs to compare the current date on X axis to the earliest date of the overall selected date range. If the date on X axis equals to the earliest date, then it returns 100%. If the date on X axis is larger than the earliest date, then it should return the real value of that date. 

    Display value = 
    VAR vFirstDate = MINX(ALLSELECTED(Data[Date]),Data[Date])
    VAR vRealValue = MAX(Data[Percentage])
    RETURN
    IF(MAX(Data[Date])=vFirstDate,1,vRealValue)

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

2 Replies

  • You can create a measure that always evaluates to 100%  (whatever that means for a given set of months on your X axis) and then add that to your line values.

     

    So - what does 100% mean for you?

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi MDSNU 

     

    You can create a measure to replace the current value field in the line chart. In this measure, it needs to compare the current date on X axis to the earliest date of the overall selected date range. If the date on X axis equals to the earliest date, then it returns 100%. If the date on X axis is larger than the earliest date, then it should return the real value of that date. 

    Display value = 
    VAR vFirstDate = MINX(ALLSELECTED(Data[Date]),Data[Date])
    VAR vRealValue = MAX(Data[Percentage])
    RETURN
    IF(MAX(Data[Date])=vFirstDate,1,vRealValue)

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.