Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Combine two different date DATA in one Graphic

Hello Guys,

 

I need to combine two different date DATA in one graphic.

Everyday i compare the data of yesterday with the same day but in W-1.

Example : i compared monday 25th of november with Monday 18th of november.

 

Can you help me please ?

 

advance thanks

  • Hi Anonymous ,

     

    You can create calendar table like DAX below, then create relationship between your fact data table and calendar table on date field.

     

    Calendar = CALENDAR(MIN(data[Date]),MAX(data[Date]))  
     
    Or
     
    Calendar =CALENDARAUTO() 

     

    Then you can create measure using calendar[Date].

     

    Total last week = CALCULATE(SUM(data[value]),DATEADD(Calendar[Date],-7,DAY))

     

    Best Regards,

    Amy

     

    Community Support Team _ Amy

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

2 Replies

  • JarroVGIT's avatar
    JarroVGIT
    Icon for Resident Rockstar rankResident Rockstar

    There isn't really much to go on here, the answer is completely dependend on your datastructure and what visual you are aiming for. Can you share sample data and which visual you want? Then we can see if we can help you out with this 🙂

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    You can create calendar table like DAX below, then create relationship between your fact data table and calendar table on date field.

     

    Calendar = CALENDAR(MIN(data[Date]),MAX(data[Date]))  
     
    Or
     
    Calendar =CALENDARAUTO() 

     

    Then you can create measure using calendar[Date].

     

    Total last week = CALCULATE(SUM(data[value]),DATEADD(Calendar[Date],-7,DAY))

     

    Best Regards,

    Amy

     

    Community Support Team _ Amy

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