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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Canknucklehead2
Frequent Visitor

Combining 2 Data Sources to Produce Year over Year Results

Trying to create a simple line chart for Year over Year comparison of sales.

 

I have two excel files in different formats. One for FY2022 and one for FY2023. They are linked via Customer Number but the column layouts are too different to allow a proper Join or Append. 

I also have a Calendar Dimension. Both files are linked to the Calendar via Invoice Date fields.

 

I've created the measures to sum up the data by months and those appear to be correct. But a line graph will only populate FY2023 information. I've added a Date Slicer and I've tried setting to Year, FY, Month, Fiscal Period - the line graph will change for FY2023, but FY2022 information just does not populate. I've also tried different graphs, but the FY2022 information won't populate. I know there's an error somewhere in my measure, but I'm not certain what it is. 

 

Invoice Sales MTD = TOTALMTD([Sales Amount], 'DIM Calendar'[Date]) provides me the relevant information for FY2023 and the line chart populates up until this month.
 
For FY2022, I've tried:
Invoice Total LYMTD = CALCULATE('FY2022 Invoice Headers'[Sales LY Total], DATEADD('DIM Calendar'[Date],-1,YEAR))

and

Invoice Total LYMTD = totalmtd([Sales LY Total], 'DIM Calendar'[DATE])
 
Any help is appreciated.
1 ACCEPTED SOLUTION
Canknucklehead2
Frequent Visitor

And, after sorting through everything, I finally noticed that the DATE column in the FY2022 table was a TEXT field and not a DATE field. **bleep** POWER BI and it's assumptions! Ugh!

Problem solved, now that it sees the date as an actual calendar date and not just text.

View solution in original post

2 REPLIES 2
Canknucklehead2
Frequent Visitor

And, after sorting through everything, I finally noticed that the DATE column in the FY2022 table was a TEXT field and not a DATE field. **bleep** POWER BI and it's assumptions! Ugh!

Problem solved, now that it sees the date as an actual calendar date and not just text.

v-tangjie-msft
Community Support
Community Support

Hi @Canknucklehead2 ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create a measure. 

Combined Sales = 
VAR FY2022_Sales = SUM('FY2022 Invoice Headers'[Sales LY Total])
VAR FY2023_Sales = SUM('FY2023 Invoice Headers'[Sales LY Total])
RETURN
IF(ISBLANK(FY2022_Sales), 0, FY2022_Sales) + IF(ISBLANK(FY2023_Sales), 0, FY2023_Sales)

(2) Then the result is as follows.

vtangjiemsft_0-1689218902469.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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