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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

sameperiode last year

Hi,

 

I want to compare data with the results in the same periode last year and have the next DAX formula:

  • Total Calls = COUNT(NLE_PowerBI_verzoeken[HID])
  • Total Calls LY = CALCULATE( [Total Calls] ;  SAMEPERIODLASTYEAR( Datum[Date]))

When i don't use a date-filter visual i see that the line "Total Calls LY" (last year) also shows the next year.

 

How can i complete the DAX formula that it have a maximum date of the current date?

 

YTD.JPG

 

 

Thanks

1 ACCEPTED SOLUTION
austinsense
Impactful Individual
Impactful Individual

The easiest way I've found to deal with this is to just check for a current value ...

 

Total Calls LY = IF( [Total Calls], 
     CALCULATE( [Total Calls] ; SAMEPERIODLASTYEAR( Datum[Date])),
     BLANK())
 

You actually don't need the third argument - BLANK() - because BLANK() is the default third argument for the IF() formula.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

View solution in original post

2 REPLIES 2
austinsense
Impactful Individual
Impactful Individual

The easiest way I've found to deal with this is to just check for a current value ...

 

Total Calls LY = IF( [Total Calls], 
     CALCULATE( [Total Calls] ; SAMEPERIODLASTYEAR( Datum[Date])),
     BLANK())
 

You actually don't need the third argument - BLANK() - because BLANK() is the default third argument for the IF() formula.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂
Anonymous
Not applicable

Thanks a lot for the solution. It works fine

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.