Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Deviation from Baseline Value

Dear all

 

I am looking for a measure which can deliver a visualisation, where I can see the deviation from a dynamically set baseline date. This baseline value is the number where all subsequent calculations regarding the deviation/change (%) are based on. This time range should be adjustable using the "between slicer".

 

 

Thanks in advance!

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    @slandolt

    I see the problem you need to all(table) to find the actual minimum date, to correct that please change the dax to the following.

    Measure = 
    VAR _BaseValue = CALCULATE(SUM([Value]),FILTER('Table',[Date]=CALCULATE(MIN([Date]),ALL('Table'))))
    VAR _CurrentValue = Sum(Value)
    
    Return _CurrentValue - _BaseValue


    Paul Zheng _ Community Support Team
    If this post helps, then consider Accept it as the solution to help other members find it faster.

7 Replies

  • Anonymous can you give an example of what you mean by baseline by date?

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Sure!

      I would like to have a dynamic measure, which calculates the % difference starting from a fixed base date.

      E.g. I set a slicer to the months between January and Aprich

      --> So 1st of January is my "Baseline vlaue", then the measure should calculate the % difference from 1st of January to 1st of February, as well as 1st of January to 1st of March, 1st of January to 1st of April.

      Or in other words:

      What I need is to be able to create an index chart which shows based on these date parameters the % change of the value over the historical period based on the time period selection I make. I should be able to use the slicers to choose the start and end date.

      • parry2k's avatar
        parry2k
        Super User

        Anonymous  try this

         

        New Measure = 
        VAR __baseDate = MIN ( DateTable[Date] ) 
        VAR __baseValue = CALCULATE ( [Your Measure], DateTable[Date] = __baseDate] )
        RETURN
        [Your Measure] - __baseValue

         

        I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

        Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.