Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Show changes in price

Hi everyone! I have been struggling with this problem for a couple of days, but I hope some of you can assist me in solving it. First, let me explain what I am dealing with and what I am trying...
  • JarroVGIT's avatar
    JarroVGIT
    6 years ago

    Hi Anonymous ,

    I have updated the file here.

    The measure for 'delta compared to last week' is this:

    LastWeek = 
    VAR _curYearWeek = SELECTEDVALUE(DateTable[yearweek])
    RETURN
    SWITCH(TRUE(),
        CALCULATE(MAX(Table3[Price]), DateTable[yearweek] = (_curYearWeek-1)) = BLANK(), BLANK(),
        MAX(Table3[Price]) = BLANK(), BLANK(),
        MAX(Table3[Price])-CALCULATE(MAX(Table3[Price]), DateTable[yearweek] = (_curYearWeek-1)))

    There are a couple of things I had to do before I got it to work. First one is to make sure the DateTable is a Whole Number type:

    Second, you need to set the Y-axis of the horizontal bar chart to categorical (otherwise yearweek like 202004 will be displayed as 0.2m:

    Have a look at the pbix, again it is Table3, DataTable and page JoostM 🙂 Ignore the rest, those are for other questions 🙂

     

    Kind regards

    Djerro123

    -------------------------------

    If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

    Keep those thumbs up coming! 🙂