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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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