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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.