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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sailesh_kumar
Frequent Visitor

Year on Year Sales Comparision

Hello All. I am currently working on a data set which has billing date and Financial year ... If Financial Year 2023 is selected it has to show the last 5 year sales and it has to compare the sales . I have data for FY 2020,2021 ,2022and 2 months of FY 2023. I have to show the comparision line of 2 months of FY 2023 with respect to the same months in the previous year . Currently it compares the partial data of 2023 with full year of 2022

sailesh_kumar_0-1655125201057.png

The DAx I have written is 

Revenue =
CALCULATE(SUM(Data[NetSales]),
filter('Calendar','Calendar'[Date] <= [stop date]))
 
Previous year =
var v_currentyear = MAX(Data[Financialyear])
return CALCULATE(SUM(Data[NetSales]),value(Data[Financialyear]) = value(v_currentyear-1))
 
Year on YEar % change =
VAR _YOYValue = [Revenue] - [Py1]
RETURN
DIVIDE(_YOYValue,[Py1],0
)
 
stop date = max('Disconnected Calendar'[Date])
 
Please help.. CUrrently it compares partial data of this year with full data of last year.. It has to compare partial data of this year with the corresponding data of previous year
 
Here is the data model
 
sailesh_kumar_0-1655134587676.png

 

Relationships:

 

sailesh_kumar_1-1655134613688.png

 

1 ACCEPTED SOLUTION

Hi @sailesh_kumar ,

 

In your measures, try to also add another filter of month. Both year=currentyear-1 and month in currentmonths.

 

 

Best Regards,

Icey

 

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

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

You can get a like for like comparison with

Revenue prev year = CALCULATE( [Revenue], DATEADD('Date'[Date], -1, YEAR))

I tried this and using this gives the year on year comparision as a flat line... This issue is arising mainly because the requirement is based on financial date as slicer 

Hi @sailesh_kumar ,

 

In your measures, try to also add another filter of month. Both year=currentyear-1 and month in currentmonths.

 

 

Best Regards,

Icey

 

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors