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
CoreyPOIA
New Member

Weird Behavior in YOY analysis?

Hi PBI Gurus,

 

I'm requesting your help in trying to figure out some weird behavior of Power BI. 

 

Take a look at my screenshot. The top graph is displaying correct data. The following fields are being used:

Total Shipped Orders = DISTINCTCOUNT (Orders)

Axis is Month ( from date table )

Legend is Year ( from date table )

 

The bottom graph is showing incorrect data for THIS YEAR. ( It seems to be adding this year and last year together )

Total Shipped Orders LY = CALCULATE( [Total Shipped Orders] , SAMEPERIODLASTYEAR( [Date] ))

 

You can see the correct, verified values in the table below both graphs.

The reason this is causing me trouble, is because I want to display a bar chart below the top graph that is % difference from last year. However, because it is not calculating current year correctly, the % change is obviously different. 

 

My % change measure is, % Change = DIVIDE ( [Total Shipped Orders LY] - [Total Shipped Orders] , [Total Shipped Orders LY], 0 )

 

For example, June % change is showing me an INCREASE of 81%, when in actuality, it should be a DECREASE of -18.5%.

 

Any idea of why this is happening? Or more importantly, how to fix it?

 

Thank you so much!Capture.PNG

 

1 ACCEPTED SOLUTION

Nevermind,

 

I just fixed it. It looks like I just had to apply a YEAR filter set to 2019.

 

Thanks for your help!

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

You seem to be using [Total Shipped Orders], which seems like a measure.

 

Can you share its calculation? In case it is a measure, is possible to have the same calculation in last year's formula itself.

 

Thanks

Yes, it is a measure, I thought I specified it's calculation in my OP. 

 

Here are my measures.

 

Total Shipped Orders = DISTINCTCOUNT( 'Orders'[Order Number] )

Total Shipped Orders LY = CALCULATE( [Total Shipped Orders] , SAMEPERIODLASTYEAR( 'Date'[Date] ) )

% Change from Last Year = DIVIDE( [Total Shipped Orders] - [Total Shipped Orders LY] , [Total Shipped Orders LY] , 0 ) 

 

My dataset is only 2018/2019.

Nevermind,

 

I just fixed it. It looks like I just had to apply a YEAR filter set to 2019.

 

Thanks for your help!

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.

Top Solution Authors