Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

KPI Visual - Last week comparison

Hello, im very new to power bi, and so im, still, a little lost week dax.   I want to make a visual that compares the last week, something like this: which the goal should be the value of la...
  • AlB's avatar
    7 years ago

    Hi Anonymous

     

    It would probably be easier to have just the week numbers instead of the 'W' plus the number. If you have the weeks in the rows of the matrix as you show, you can use a measure like:

     

     

    Measure=
    VAR  _CurrentWeek = SELECTEDVALUE(Table1[Week])
    VAR _PreviousWeek=  "W" & VALUE(MID(_CurrentWeek, 2, LEN(_CurrentWeek)-1))-1
    RETURN
    CALCULATE(SUM(Table1[realizadas]), Table1[Week]=_PreviousWeek)