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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
CheanSereyvatan
Frequent Visitor

How to ignore the future date in Calculation

Hi beloved community team,
Recently, I'm facing 1 issue on 3 mobth distribution calculation method. All work well only issue on the future date that I don't want it to appear on the chart. Here is my calculation : 
Distribution Count = COUNTROWS(CALCULATETABLE(SUMMARIZE('IMS_Daily Sale','IMS_Daily Sale'[Customer ID]),'IMS_Daily Sale'[QtyWithoutDiscount]>0,DATESINPERIOD(DimDates[Date],Max(DimDates[Date]),-3,MONTH)))
 
Thanks for your kindly support.
Vatanak CK
1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @CheanSereyvatan ,

 

not sure what you mean by future dates, elaborate more on this.

 

This measure only contains the DATESINPERIOD part from yor measure:

theMaxDate = 

var theDates = DATESINPERIOD( 'DimDate'[Datekey] , MAX( 'DimDate'[Datekey] ) , -3 , MONTH )
RETURN
MAXX( theDates , 'DimDate'[Datekey] )

As you can see from the below visualizations

  • the card visual shows the last day of the calendar table, because the last day of the calendar table is the 31st, December of 2011 (this is because I use an old Contoso Retail DW demo data set)
  • the table visual with has the datekey from the calendar table on the rows and for this reason the calendar table is filtered accorcingly

image.png

It's necessary that you elaborate on "Future Dates" and also on the visual and what you want to achieve from a data visualization point of view and the date filter that you are applying inside your measure.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey @CheanSereyvatan ,

 

not sure what you mean by future dates, elaborate more on this.

 

This measure only contains the DATESINPERIOD part from yor measure:

theMaxDate = 

var theDates = DATESINPERIOD( 'DimDate'[Datekey] , MAX( 'DimDate'[Datekey] ) , -3 , MONTH )
RETURN
MAXX( theDates , 'DimDate'[Datekey] )

As you can see from the below visualizations

  • the card visual shows the last day of the calendar table, because the last day of the calendar table is the 31st, December of 2011 (this is because I use an old Contoso Retail DW demo data set)
  • the table visual with has the datekey from the calendar table on the rows and for this reason the calendar table is filtered accorcingly

image.png

It's necessary that you elaborate on "Future Dates" and also on the visual and what you want to achieve from a data visualization point of view and the date filter that you are applying inside your measure.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.