Forum Discussion
DAX - Filtering blank if same key with reference to another column is blank
Hi DAX team,
I am having filtering concept that's scratching.
i want to show null or blank if the same [key] is used with reference to the [Payment Date] that is blank, currently it's showing the date '02/02/2022' but if payment date is part of the same key then dont show the date in the [payment date (final)] column. but the requirement also requires showing the max date if same key in [payment date (final)] column does not contain any blanks.
I tried to use the below dax query which does find the max date but i cant filter out if its blank.
Any help is much appreciated. thanks!!
Hi deng2431 ,
Please try:
Payment date(Final) = VAR _a = CALCULATE ( MAX ( 'Table'[Payment Date] ), FILTER ( 'Table', [Key] = EARLIER ( 'Table'[Key] ) ) ) VAR _b = SELECTCOLUMNS ( FILTER ( 'Table', [Key] = EARLIER ( 'Table'[Key] ) ), "Payment Date", [Payment Date] ) RETURN IF ( BLANK () IN _b, BLANK (), _a )Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- v-jianboli-msft
Community Support
Hi deng2431 ,
Please try:
Payment date(Final) = VAR _a = CALCULATE ( MAX ( 'Table'[Payment Date] ), FILTER ( 'Table', [Key] = EARLIER ( 'Table'[Key] ) ) ) VAR _b = SELECTCOLUMNS ( FILTER ( 'Table', [Key] = EARLIER ( 'Table'[Key] ) ), "Payment Date", [Payment Date] ) RETURN IF ( BLANK () IN _b, BLANK (), _a )Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- deng2431
Helper I