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
nimp_kp
Frequent Visitor

Same period as last year in a line chart

Hi

 

I want to create a line chart that show this years accumulated numbers from february 1st until july 1st, compared to the accumulated numbers in the same period last year.

I have made two measures that calculates the accumulated numbers for 2018 and 2019 but when I use the date column, the two lines are shown side by side.

 

Any tips to how to create a date column that doesn't show the year, so the lines are shown on top of each other?

 

picture.jpg

1 ACCEPTED SOLUTION
TeigeGao
Solution Sage
Solution Sage

Hi @nimp_kp ,

In your scenario, we can create two calculated column using the following DAx query:

Month = Table1[Data].[Month]
Year = YEAR(Table1[Data])

Then we can create two measures:

2018 = CALCULATE(SUM(Table1[Value]),Table1[Year] = 2018)
2019 = CALCULATE(SUM(Table1[Value]),Table1[Year] = 2019)

The result will like below:

PBIDesktop_DSAgFhFU9B.png

Best Regards,

Teige

View solution in original post

2 REPLIES 2
TeigeGao
Solution Sage
Solution Sage

Hi @nimp_kp ,

In your scenario, we can create two calculated column using the following DAx query:

Month = Table1[Data].[Month]
Year = YEAR(Table1[Data])

Then we can create two measures:

2018 = CALCULATE(SUM(Table1[Value]),Table1[Year] = 2018)
2019 = CALCULATE(SUM(Table1[Value]),Table1[Year] = 2019)

The result will like below:

PBIDesktop_DSAgFhFU9B.png

Best Regards,

Teige

Anonymous
Not applicable

How did you order the month starting from March?

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.