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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Aza33ello
Regular Visitor

Sum of last non blank value between two dates

Hello!

 

I have some troubles with dax measure and would appreciate any help.

 

Screenshot below shows example data, I want to make dax measure that can sum the last non-blank value for previous 6 month before Jan 2022, should be 2,00 here:

Aza33ello_3-1677761186897.png

 

4,00 for that:

Aza33ello_4-1677761293316.png

 

and nothing for this:

Aza33ello_5-1677761390090.png

For instance, normally If my current date filter is Jan 2023 the measure will show me sum of Jan 2022 but if Jan 2022 is empty the measure should find the last value close to Jan 2022 within 6 months and sum (Nov 2021 on Pic#1, Sep 2021 on Pic#2 and nothing on Pic#3) 

 

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

All measures are in the attached pbix file.

I hope the below sample can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_1-1677819339141.png

 

Jihwan_Kim_0-1677819322673.png

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.