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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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