Forum Discussion

Sean2's avatar
Sean2
Helper I
5 years ago
Solved

Comparing years from separate sources

Hello knowledgeable ones.

I’m trying to create a data model that can be used to compare multiple years on a line chart. With a line for hours of each activity, that can be filtered/sliced to show all years or just one at a time. And another line chart for hours of activity by day of week for the same.

Thanks for any ideas

 

Here's a sample of the data I'm working with:

https://drive.google.com/drive/folders/1JzcPmlL7egqLzsbJz72tMW0mRpdh0nD-

  • Sean2 

    Go to Date table, select month name column then sort by "Month Sort"

     

     

5 Replies

  • aj1973's avatar
    aj1973
    Community Champion

    Hi Sean2 

    I did some cleaning and transforming on your model. and I got this

     

    I am not sure where do you get the Tables (2018,2019....) from but you need delete un necessary columns from them and append them. Then add column for number of

    Hours = DATEDIFF('Append Tables'[In],'Append Tables'[Out],HOUR)

    and another column for the

    Year Activity = YEAR('Append Tables'[In])  (by th way I chose dates IN, you pick what you want)

     

    One more thing, in your table 2021, you have dates IN and OUT like here 

    that don't make sense and need attention.

     

    Last thing: I uploaded the Pbix file that I corrected to your drive.

     

    • Sean2's avatar
      Sean2
      Helper I

      Thanks Amine! That helps a great deal and I think I'm on the right track to what we need. You are right there are some problems with the data integrity in this sample and I will need to correct them.

       

      The visual I'm looking to get would be like the area chart at the bottom, but show January through December and if multiple years were selected it would compare the hours of each year.

      Do you have any ideas how that could be acomplished?

       

      Thanks!

      • aj1973's avatar
        aj1973
        Community Champion

        Hi Sean2 

        Not sure I understood, is this what you want to see

        For years

         

        Months