Forum Discussion

jedsh08's avatar
jedsh08
Frequent Visitor
4 years ago
Solved

Get information based on date range

Hello , 

I am really new to the world of data and also with power bi. I am trying to do a comparison between information on date ranges. 

I am pulling out 07 days information (Friday to Thursday) with a date filter and I want information on the 07 days which precede the first selection.
I explain more, what I want is to compare the week S ( Friday to Thursday) to S-1 (previous friday to Thursday).
And then I can make my comparison.

Thank

9 Replies

  • There is a DAX function DATEADD  that you can use for that. It is recommended that you use a proper calendar table in your data model.

    • jedsh08's avatar
      jedsh08
      Frequent Visitor

      Thank you it helps .

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, jedsh08 

     

    I simply simulated some data hoping to restore your problem.

    Date2 = DATEADD('Table'[Date],-7,DAY)
    Value2 =
    LOOKUPVALUE ( 'Table'[Value], 'Table'[Date], [Date2] )
    

    If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

     

    Best Regards,

    Community Support Team _Charlotte

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

    • jedsh08's avatar
      jedsh08
      Frequent Visitor

      After trying what you have said, I understand that it will work, but I have another problem when applying your solution. I am connected in DirectQuery mode and when trying calculate columns, I cannot find the LOOKUPVALUE() function. 

      Can you tell me what's wrong? 

      Thanks for your help.