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
kylee_anne
Helper II
Helper II

Latest Date when value>0

What am I doing wrong?

 

Silo1 = CALCULATE(sum('Cement & Silo Data'[Value]),'Cement & Silo Data'[Description]="Silo 1 Actual (t)",'Cement & Silo Data'[Value]>0 &&'Cement & Silo Data'[Date]=MAX('Cement & Silo Data'[Date]))
 
From this data
 
kylee_anne_0-1753840648720.png

 

Thanks.

1 ACCEPTED SOLUTION
Rakesh1705
Super User
Super User

Source Data

Rakesh1705_0-1753936077519.png

Unpivot the value columns (including also the columns with 0 value)

Rakesh1705_1-1753936191215.pngRakesh1705_2-1753936224499.png

Changing the data type of Attribute

Rakesh1705_3-1753936260151.png

Create a measure called latest date with max formula

Rakesh1705_4-1753936305330.png

Using a table visual

Rakesh1705_5-1753936754184.png

Now if you want to see only the latest date of actual then there are multiple ways
1. using slicer

Rakesh1705_7-1753936994867.png

2. Using filter pane

Rakesh1705_8-1753937032569.png

3. by updating the latest date formula

Rakesh1705_9-1753937124249.png

You can choose whichever is suitable for your case scenario.

If it solves your query then requesting you to accept the solution.

View solution in original post

3 REPLIES 3
Rakesh1705
Super User
Super User

Source Data

Rakesh1705_0-1753936077519.png

Unpivot the value columns (including also the columns with 0 value)

Rakesh1705_1-1753936191215.pngRakesh1705_2-1753936224499.png

Changing the data type of Attribute

Rakesh1705_3-1753936260151.png

Create a measure called latest date with max formula

Rakesh1705_4-1753936305330.png

Using a table visual

Rakesh1705_5-1753936754184.png

Now if you want to see only the latest date of actual then there are multiple ways
1. using slicer

Rakesh1705_7-1753936994867.png

2. Using filter pane

Rakesh1705_8-1753937032569.png

3. by updating the latest date formula

Rakesh1705_9-1753937124249.png

You can choose whichever is suitable for your case scenario.

If it solves your query then requesting you to accept the solution.

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attahced pbix file.

 

Jihwan_Kim_1-1753844957771.png

 

 

Jihwan_Kim_0-1753844931802.png

 

 

Expected result Last Non Blank value: =
VAR _lastnonblankdate =
    MAXX (
        FILTER (
            ALL ( 'Calendar'[Date] ),
            CALCULATE ( SUM ( 'Cement & Silo Data'[Value] ) <> 0 )
        ),
        'Calendar'[Date]
    )
RETURN
    CALCULATE (
        SUM ( 'Cement & Silo Data'[Value] ),
        KEEPFILTERS ( 'Calendar'[Date] = _lastnonblankdate ),
        KEEPFILTERS ( 'Description'[Description] = "Silo 1 Actual (t)" )
    )

 


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.
Irwan
Super User
Super User

hello @kylee_anne 

 

from your dax, seems you are looking for sum of value.

 

if you want to get latest date, perhaps something like below (i assumed this is in measure form).

calculate(
   max('date'),

   filter(

      all('table'),

      'value'>0&&'description'="Silo 1 Actual(t)"))

 

Thank you.

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.