Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nosaj03
Helper II
Helper II

New update: Dual Axis line chart assistance

Hello all! I recently updated to the latest release and I am overjoyed that they now have dual axis line charts. 

 

I have data by day from the beginning of 2019 to current. I would like to use the dual axis functionality to show 2019 vs 2020. 

 

No I know I was able to do this previously without the need of another axis but I also want to bring in the day of the year so they line up accordingly. 

 

How do I go about doing this?

6 REPLIES 6

@amitchandak thank you for the link. I read through it and it does tell me how to use the Y2 field but it only pertains to different data sets. 

 

My data is in a single column sorted by date and what Im looking to do is show a line for each relevant day Year over year similar to below which was done in Excel. 

 

 image.png

Hi @nosaj03 ,

 

hhh3.PNG

2019 = 
CALCULATE(
    SUM(Sheet3[Vale]),
    FILTER(
        Sheet3,
        Sheet3[Date].[Year] = 2019
    )
)

2020 = 
CALCULATE(
    SUM(Sheet3[Vale]),
    FILTER(
        Sheet3,
        Sheet3[Date].[Year] = 2020
    )
)

Use "Month" and "Day" to create a common axis and compare the data for each day in different years.

 

Best regards,
Lionel Chen

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

@v-lionel-msft this is perfect. The only issue is that its now looking at the specific dates which can compare a Sunday to Monday depending on the differences between the years. How can I compare based on day of the week. For example 1/2/2020 was the first Thursday in January but the first Thursday in January 2019 was 1/3/2019. I dont want to compare 1/2/2020 to 1/2/2019 because they fall on different days. I'm trying to compare relative days year over year. 

Hi @nosaj03 ,

 

How about creating such a common axis?

//Calculated column
Week = 
VAR week_num = WEEKNUM([Date],2)
VAR week_day = WEEKDAY([Date],2)
RETURN
week_num & "-" & week_day 

You can add this calculated column to the line chart as the X axis.

 

Best regards,
Lionel Chen

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

@nosaj03 

You have to use trailing year measure

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.