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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ADOalan1
Frequent Visitor

Help with Dax formula

Hi,

 

I have the below DAX to givem e back first, second, third payment date but looking at the row highlighted I need to stop if let's say are only two dates so that the third payment date will be empty.

 

I need to add the additional code to this dax.

 

ADOalan1_0-1681382337243.png

 

Any help will be much apprecaited

 

Thanks

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share some data, describe the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @ADOalan1 

You can try the following code

Date 3 =
VAR _top3 =
    TOPN ( 3, nfp_donation, nfp_donation[Income Date], ASC )
VAR _count =
    COUNTROWS ( SUMMARIZE ( _top3, nfp_donation[Income Date] ) )
RETURN
    IF (
        _count > 2,
        IF (
            HASONEVALUE ( nfp_donation[Form ID] ),
            MAXX ( _top3, nfp_donation[Income Date] )
        )
    )

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.