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
vanessafvg
Super User
Super User

Previous Year Calculation plotting oddly on line graph

graph.PNG

as you can see from the line graph i have a revenue measure and previous year revenue.   What i dont understand is why doesn't the PY plot the same as the revenue.

 

this is the measure for the revenue

Revenue = CALCULATE(Sum(Registrations[MRR]) + sum(Sales[RevenueNettAmount])) 

this is the measure for PY

PY Revenue = CALCULATE([Revenue], SAMEPERIODLASTYEAR(ALLSELECTED('Fiscal Date'[Date])))

 

I would like the value to plotted on the line graph in the same way, what am i missing?  The other thing is these seem to be bring back exactly the same values

 

Capture.PNG





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




8 REPLIES 8
MalS
Resolver III
Resolver III

How does PY Revenue = CALCULATE([Revenue], SAMEPERIODLASTYEAR('Fiscal Date'[Date])) look?

ah yes sorry my mistake, the problem with that, which i did before i changed it to this was because i have a filter on date on my dashboard as in year month it brings back 0  

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




The date filter shouldn't stop SAMEPERIODLASTYEAR from working without ALLSELECTED. Any chance there was actually 0 revenue last year in your data?

nope 🙂    There is data for the previous year, but what is interesting is that its duplicating the current years data in the PY measure.. something is off..





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Yeah - strange. The only other thing I would suggest is to check the date column in the SAMEPERIODLASTYEAR formula - it needs to be a proper calendar table (no missing dates, no duplicates, must cover the entire period of your data). Otherwise, without seeing the file, I am not sure what is going on.

it comes from the dim date column in the dw so i hope its fully populated but i would think so since its in daily use in the dw.   ive obviously done something somewhere!





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




from whatCapture.PNG perspective?  see first graph for how it is plotting as opposed to revenue. 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Not sure if you noticed, but I changed the formula slightly for PY Revenue - I was wondering if that gave results that made more sense.

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.