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
deng2431
Helper I
Helper I

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.

 

Payment date (Final) = calculate(max(Test[Payment Date]),FILTER(allexcept(Test, Test[Key]),Test[Payment Date] <>BLANK()))

 

deng2431_1-1668019045800.png

 

Any help is much appreciated. thanks!!

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
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:

vjianbolimsft_0-1668063912430.png

 

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.

View solution in original post

5 REPLIES 5
deng2431
Helper I
Helper I

HI @v-jianboli-msft ,

 

Thank you!!!! your solution works amazing!!!!

v-jianboli-msft
Community Support
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:

vjianbolimsft_0-1668063912430.png

 

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.

djurecicK2
Super User
Super User

Hi @appsac1

 I'm not sure that I totally understand the requirements.

Is this what you are looking for? (calculated column)

Capture44.PNG

appsac1
Helper I
Helper I

Hi @djurecicK2 ,

 

No, the opposite. if Payment date is blank and same/recurring [Key] exists with another Payment date then dont show anything in the [Payment date (Final)]. but do show the max date if there are no blank payment date for same/recurring [Key].

 

djurecicK2
Super User
Super User

@deng2431 So, if Payment date is blank, you want Payment date (Final) to be the Max Payment date with the same Key. Is that right?

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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