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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
rveerasamy
Helper III
Helper III

when applying filter should not affect dax measure

Hi Experts,
 
I'm searching for solution that when applying filter it should not affect dax.
 
Days To Fulfill =
VAR childorderdate =CALCULATE(
    MAXX(CALCULATETABLE('PBI_BBA_SALES',FILTER('PBI_BBA_SALES',NOT ISBLANK('PBI_BBA_SALES'[Ref Id]) ) ),PBI_BBA_SALES[Order Date])
)
Return DATEDIFF(MAX('PBI_BBA_SALES'[Order Date]),childorderdate,DAY)
 
 
this is the measure I have created but when I add filter to the table it should not affect the dax
this is the solution I need
1 REPLY 1
tamerj1
Super User
Super User

Hi @rveerasamy 

please clarify what do you mean by "when I add filter to the table it should not affect the dax"

Also both CALCULATE and CALCULATETABLE are doing nothing in this case. Can simply write 

Days To Fulfill =
VAR childorderdate =
MAXX (
FILTER ( 'PBI_BBA_SALES', NOT ISBLANK ( 'PBI_BBA_SALES'[Ref Id] ) ),
PBI_BBA_SALES[Order Date]
)
RETURN
DATEDIFF ( MAX ( 'PBI_BBA_SALES'[Order Date] ), childorderdate, DAY )

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.