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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
tmullady
Regular Visitor

Help

Hello,

 

I have a data set with the following fields.  The Date field uses the end of month date.

 

Date , Sales, Sales Target

 

I want to create a Bar chart that compares Sales, Sales Target, YoY Sales, and Linked period Sales.

 

How can I calculate YoY and Linked periods? 

 

Lets say a user selects 01/31/15, 02/28/15, and 03/31/15 in the slicer. The bar chart is summing up Sales and Sales Target.  I need help getting the YoY and Linked Periods into the bar chart.

 

In SSRS I could use expressions with Date functions. 

 

Any help would be greatly appreciated.

 

Thanks,

 

Tim

1 REPLY 1
kcantor
Community Champion
Community Champion

My first suggestion is to create a measure to sum up your Sales (etc). Then do a measure for last year sales using DateAdd.

For your sales, it should be something as simple as:

Total Sales = SUM[Sales]

Last Year Sales = CALCULATE([Total Sales], DATEADD(Date[DateKey], -1, year) )

The rest is calculations using those measures

YOY=[Total Sales]-[Last Year Sales]

 

Generally speaking, however, I tie my date to an order date or an invoice date. Never tried using just the end of the month. PowerBI will pull them into months using slicers for you.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors