Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Making 2 y-axis with same parameter

Hello dear community,

I had 2 tables named impact I made one for 2019 and 2020 with the same attributes

 

 

                               impact 2020                                                                         Impact 2019

I made a graph to compare the number of impacts in different years each month by counting id of the 2 tables in y-axis as shown below

  

I decided after that to merge the two tables into one named impact but I couldn't make the comparison based on year same as in the previous visualization I tried to filter or make a measure but I didn't know how 

Is there any solution to do that??

Thank you in advance

 

3 Replies

  • Do the  Impact 2019 and Impact 2020 only have the month name o0r number and not a date?

    They need a date. You can't do date intelligance with just the month name or number.

    Use Power Query to add date column eg the first or last date of each month for 2019 and 2020.

    The relate the date to the calendar file.

    You cam then slice, dice, subtotal and graph by year, month, quarter etc


    Do these free Power BI Calenadr training modules

    https://www.youtube.com/playlist?list=PL7GQQXV5Z8eczWqKFMDVoHMjTcpH3tgZm&cbrd=1

     

    Otherise ....  we want to help you but your description is too vaugue. Please write it again clearly.

    Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
    Also provide the example desired output, with a clear description of the process flow.

    Remember not to share private data ... we don't want you to get into trouble. 😧

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi speedramps 

      First I want to thank you for your reply,

      For the date yes I made a calendar I named it date also in impact 2019 and 2020 they had a date attribute

      here's a sample of my table impact (impact 2019 and 2020 have the same structure so I merged them into one single impact table) 

      And here's the calendar also I set up the relation between the 2 tables

       

       

      What I wanted to do is make a comparison of impacts in two years by month same as the visualization below

      Note: this graph I made it when I had two tables (impact 2019 and impact 2020) but now I merge these tables into one table named impact and couldn't make the same graph above

       

  • Try somthing this

     

    TotalSales = SUM(FactTable[Value])

     

    Sales2019 = CALCULATE(TotalSales, 'Calendar'[Year] = 2019)

     

    Sales2020 = CALCULATE(TotalSales, 'Calendar'[Year] = 2020)

     

    Then drawa  link graph of Sales2019 and Sales2020 by month