Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Sparkline with column headers as dates

I've got a table that looks like the one shown below. How can I make a sparkline work so that it compares the four values for each week & compare them?

 

 

1 Reply

  • Anonymous , better to unpivot the column in power query and then you will have week on row

     

    Have table with distinct week

     

    Week = distinct(Table[Week])

     

    Add rank , based on the current format it should work, better is week WW format or YYYYWW format

    Week Rank = RANKX('Week ','Week '[Week],,ASC,Dense)

     

    Then you can have meaures like

     

    This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
    Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

     

     

    You can use independent tables of the week to select the week of your choice

     

    How to use two Date/Period slicers

    https://youtu.be/WSeZr_-MiTg