Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

line graph display

hi 

i have a line graph showing data for entire last year and current year 2 months but my current year data is displaying in right side 

i am looking for data to be displayed left side below jan 2020 i want jan 2021.

 

 

  • Hi Anonymous,

     

    You can use date hieracrchy as:

    Here is the output:

     

    Best Regards,

    Link

     

3 Replies

  • v-xulin-mstf's avatar
    v-xulin-mstf
    Community Support

    Hi Anonymous,

     

    You can use date hieracrchy as:

    Here is the output:

     

    Best Regards,

    Link

     

  • Anonymous 

    Did you create a calendar table that connected with your Data table ? If no , then you need to create it. You can find million scripts to create it , if you can't find any let me know.

     

    Then connect calendar table with your "Date" field as a key with your data table.

     

    Then Create a measure for current year :  Revenue_CY = Sum(gross_sales)

    For LY you need to create a measure like this : Revenue_LY = Calculate(Revenue_CY ,sameaslastperiod(calendar[date])) or Revenue_LY = Calculate(Revenue_CY ,dateadd(calendar[date],-1,Year))

     

    Hope that can work for you as worked for me.

     

    Don't forget to give thumbs up 👍and accept this as a solution if it helped you.