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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
pvaldiviag
New Member

Problems with SAMEPERIODLASTYEAR

Hello,

I'm using this formula.

ROE = CALCULATE(SUM([Monto]),'Terminos Financieros'[TF_id]=17,DATESINPERIOD(Tiempo[Fecha],LASTDATE(Tiempo[Fecha_fin]),-12,MONTH))
/ IF(HASONEVALUE(Tiempo[Year]),((CALCULATE([SumMontos],'Terminos Financieros'[TF_id]=7)+CALCULATE([SumMontos],'Terminos Financieros'[TF_id]=7,SAMEPERIODLASTYEAR(Tiempo[Fecha])))/2),BLANK())

And I have a date slicer.

I'm using a "Card" Visual to display the value. When I select only one date the value shows without problem. When I select more than one date the value goes to "Infinity". I know this probably is intended but is there a way to avoid getting that value.?

 

BTW this formula works normally using a different visual, I'm only having problemas with the "Card" visual.

 

Example:

roe1.PNGroe2.PNG

3 REPLIES 3
Sean
Community Champion
Community Champion

@pvaldiviag Infinity show up when you divide by blank

 

instead of / => Try using the DIVIDE funcion like this => DIVIDE ( [numerator], [denominator], 0)

 

This should take care of it - if otherwise the formula works fine!

 

Hey,

Thanks for the quick answer.

The solution you provided works partially. It now shows a BLANK value.

I'm trying to show the same value as the image I provided.

I hope there's a solution for this 😞

 

Greetings,

Sean
Community Champion
Community Champion

@pvaldiviag to get rid of a Blank in the Card - you have to surround it with IF ( ISBLANK (...

 

=> IF ( ISBLANK(expression), 0, expression)

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.