Forum Discussion

Kurt_C's avatar
Kurt_C
New Member
3 years ago
Solved

Using Custom Dates for Visuals based on FIltered Report Date

Hello,   I am new to PowerBI and have been reading through documentation and DAX trainings to learn as quickly as possible, but I have yet to find a good way to go about what I am looking to do. An...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Kurt_C ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    CALENDAR = CALENDAR(DATE(2023,1,1),DATE(2023,12,31))

    (2) We can create a measure. 

    Flag = SWITCH(TRUE(),
    MAX('Table'[date])=SELECTEDVALUE('CALENDAR'[Date])-1,1,
    MAX('Table'[date])=SELECTEDVALUE('CALENDAR'[Date])-2,2,
    MAX('Table'[date])=SELECTEDVALUE('CALENDAR'[Date])-3,3,
    MAX('Table'[date])=SELECTEDVALUE('CALENDAR'[Date])-4,4,
    MAX('Table'[date])=SELECTEDVALUE('CALENDAR'[Date])-5,5)

    (3) Create five line graphs, then filter the visual objects with [Flag]=1/2/3/4/5, and select different dates on the slicer without changing the visual objects again.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.