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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Kartic21
Helper I
Helper I

Creating Year over Year sales but its giving infinite when clicked on particular year in trend chart

I am trying to create YoY% KPI but having issue when i click on partcular/one entering year on the chart it gives infnity.
sample data 

Kartic21_0-1693459823533.png

Formula :

Year over year perc =
var cy = max('Table'[Year])
var py = MAXX(ALL('Table'),'Table'[Year])-1
var cyenroll = CALCULATE([Totalenroll],FILTER('Table','Table'[Year]=cy))
var pyenroll = CALCULATE([Totalenroll],'Table','Table'[Year]=py)
return (cyenroll-pyenroll)/pyenroll
//(cyenroll-pyenroll)/pyenroll)


issue : when i click on any entering year in trend chart ,,its show infinty...it seems like it cant calculate pyenroll value

Kartic21_1-1693459998519.png

 



Can any please help on this..? Thanks



 

 

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

You should ideally create a Date column first (can be Jan 1 of tht row's year) and then a calendar Table.  From thereon, the calcualtions will become simple.  To receive further help, share some data to work with?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

instead of /  use DIVIDE  and provide an alternative result if the previous year's data is blank

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.