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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Karthik12
Post Patron
Post Patron

DAX filter support for customized date

Hello Team,

Long time I am trying to get the solution for my requirement.

I would like to get a table with customized start date and end date.

Start date is 27.12.2022 and end date is always today minus 1 day (Start date is fixed and end date is dynamic like today minus 1 day)

 

 

Karthik12_0-1674981803965.png

 

 

Pbix file link :

https://vontier-my.sharepoint.com/:u:/g/personal/karthikeyan_palanisamy_gilbarco_com/EZvVsD0KXQZMvbe...

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Karthik12 ,

You can create a calculated column as below to get the date range and apply the filter on the visual with the condition(Flag is not blank). Please find the details in the updated sample pbix file.

 

 

Flag = 
IF (
    'dates'[Date] >= DATE ( 2022, 12, 27 )
        && 'dates'[Date]
            <= TODAY () - 1,
    'dates'[Date],
    BLANK ()
)

 

 

Create a calculated columnCreate a calculated column

Apply visual level filter with the condition (Flag is not blank)Apply visual level filter with the condition (Flag is not blank)

Best Regards

View solution in original post

6 REPLIES 6
Karthik12
Post Patron
Post Patron

@Anonymous  Thanks you so much. It working fine.

Small issue if we apply for a large number of data,  so many blanks in plan and actuals columns. Is there any measure to hide it?

If Plan and Actual both Zero or blank, can we hide it?

Karthik12_0-1675314087578.png

 

 

Anonymous
Not applicable

Hi @Karthik12 ,

Please update the formula of measure [Plan_sum] and [Actual] as below and check if it can return the correct result. Please find the details in the attachment.

Plan_sum = 
VAR _sumofplan =
    SUM ( 'Plan sheet'[plan] )
RETURN
  IF ( ISBLANK ( _sumofplan ) || _sumofplan = 0, BLANK (), _sumofplan )
Actual = 
VAR _sumofactual =
    SUM ( 'Production sheet'[Pro Qty] )
RETURN
    IF ( ISBLANK ( _sumofactual ) || _sumofactual = 0, BLANK (), _sumofactual )

Best Regards

Hi @Anonymous Thanks. 

Is it possible to replace Blank with 0 either plan or actual exists?

Karthik12_6-1675412104605.png

 

ppm1
Solution Sage
Solution Sage

Have you tried this table expression already?

 

dates = CALENDAR(DATE(2022,12,27),TODAY()-1)
 
Pat
 
Microsoft Employee

Hi @ppm1 Thanks ! 

I am new to DAX . started learning that one. also, Never tried before expression. I am bit diffcult to catch this expression like where to apply. Can you please apply in the pbix file and revert?

 

Anonymous
Not applicable

Hi @Karthik12 ,

You can create a calculated column as below to get the date range and apply the filter on the visual with the condition(Flag is not blank). Please find the details in the updated sample pbix file.

 

 

Flag = 
IF (
    'dates'[Date] >= DATE ( 2022, 12, 27 )
        && 'dates'[Date]
            <= TODAY () - 1,
    'dates'[Date],
    BLANK ()
)

 

 

Create a calculated columnCreate a calculated column

Apply visual level filter with the condition (Flag is not blank)Apply visual level filter with the condition (Flag is not blank)

Best Regards

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors