Forum Discussion
Fsciencetech
Helper III
5 years agoDax formula not working
Hi folks, Need your help, I don't want to sum to [SupplierPOCreated], Only need to subtract, how do modify below dax. Material Age = CALCULATE( DATEDIFF( MAX( OSMSData[OSLastReplanDate].[D...
- 5 years ago
Hi Fsciencetech ,
Or try this formula.
Material Age = CALCULATE( DATEDIFF( MAX( OSMSData[OSLastReplanDate].[Date] ), MAX( OBFact_Current[SupplierPOCreated].[Date] ), DAY ), FILTER( OBFact_Current,OBFact_Current[FutureCrdFlag] = "N" && OBFact_Current[SupplierPOCreated].[Date] <> BLANK() ) )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
5 years agoFsciencetech , Try like
CALCULATE(
DATEDIFF(
MAX(
OSMSData[OSLastReplanDate].[Date]
),
MAXX(OBFact_Current,OBFact_Current[SupplierPOCreated].[Date]),DAY),
FILTER(
OBFact_Current,OBFact_Current[FutureCrdFlag] = "N" && not(isblank(OBFact_Current[SupplierPOCreated] ))
) )
do not .date if there is not timestamp
also refer my blog on date diff
- Fsciencetech5 years ago
Helper III
Thanks Amit, Let me check your dax result.
- v-lionel-msft5 years ago
Community Support
Hi Fsciencetech ,
Or try this formula.
Material Age = CALCULATE( DATEDIFF( MAX( OSMSData[OSLastReplanDate].[Date] ), MAX( OBFact_Current[SupplierPOCreated].[Date] ), DAY ), FILTER( OBFact_Current,OBFact_Current[FutureCrdFlag] = "N" && OBFact_Current[SupplierPOCreated].[Date] <> BLANK() ) )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.