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

Win a FREE 3 Day Ticket to FabCon Vienna. Apply now

Reply
Emranit
Helper II
Helper II

Need a help regarding latest date by DAX

I have a production related dashboard which connected from SQL server. Here I manually select Date and found Production according to selecting date. I need a DAX which will be work for show latest date and data according to latest date. When a user open the Dashboard it will be show last day date & data. Suppose today 1st March, Dashboard will be present 28 February  with  production Data.

 

https://docs.google.com/spreadsheets/d/12XphOetMX17Z5m3iC4MKbGEWMooGm-wd/edit?usp=drive_link&ouid=11...

 

https://drive.google.com/file/d/1CvQJI7FQarN0Ksosjx_6Qml5ymYs5ad6/view?usp=drive_link

 

In the link, there are 2 files for an example. Please help me in this regard.

1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @Emranit ,

 

To display the latest available production date and corresponding data in your Power BI dashboard using DAX, you can create a measure that always returns the maximum (latest) available date from your dataset. You can define it as follows:

Latest_Date = MAX('YourTable'[EndTime])

Once you have the latest date, you need another measure that filters and sums the Weight column for that latest available date.

Latest_Production = 
CALCULATE(
    SUM('YourTable'[Weight]),
    'YourTable'[EndTime] = [Latest_Date]
)

If you want to ensure that the dashboard always shows data up to the last completed day (yesterday) instead of the maximum available date (which might include future dates), you can modify the Latest_Date measure like this:

Latest_Date = 
CALCULATE(
    MAX('YourTable'[EndTime]),
    'YourTable'[EndTime] <= TODAY()-1
)

With these measures, when a user opens the dashboard, the visuals will dynamically display the production data for the most recent day that has available data. If today is March 1, 2025, the dashboard will show the data for February 28, 2025. As new data is added, the dashboard will automatically update to reflect the latest production date and values.

 

Best regards,

View solution in original post

4 REPLIES 4
v-mdharahman
Community Support
Community Support

Hi @Emranit,

Thanks for reaching out to the Microsoft fabric community forum.

 

It looks like you are looking for a DAX Query which will show the latest date and data accordingly. As @DataNinja777 already provided a response to your queries, please go through it and accept it as solution if it helps you in solving the issue.

 

I would also take a moment to thank @DataNinja777, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

DataNinja777
Super User
Super User

Hi @Emranit ,

 

To display the latest available production date and corresponding data in your Power BI dashboard using DAX, you can create a measure that always returns the maximum (latest) available date from your dataset. You can define it as follows:

Latest_Date = MAX('YourTable'[EndTime])

Once you have the latest date, you need another measure that filters and sums the Weight column for that latest available date.

Latest_Production = 
CALCULATE(
    SUM('YourTable'[Weight]),
    'YourTable'[EndTime] = [Latest_Date]
)

If you want to ensure that the dashboard always shows data up to the last completed day (yesterday) instead of the maximum available date (which might include future dates), you can modify the Latest_Date measure like this:

Latest_Date = 
CALCULATE(
    MAX('YourTable'[EndTime]),
    'YourTable'[EndTime] <= TODAY()-1
)

With these measures, when a user opens the dashboard, the visuals will dynamically display the production data for the most recent day that has available data. If today is March 1, 2025, the dashboard will show the data for February 28, 2025. As new data is added, the dashboard will automatically update to reflect the latest production date and values.

 

Best regards,

Hi Dear,

Thanks for nice cooperation. Moreover I want to show latest date and production according to latest date if I didn't select any date. Everday I will open dashboard and it will present last data and production according to last date. Please help me. Here weight means production.  please check both link.

 

https://drive.google.com/file/d/1weGhcEUkdsuKwzYiGO2PUqbZHQsldpvG/view?usp=sharing

 

https://docs.google.com/spreadsheets/d/1xAzD4Xsapxd68tx7bn-yl2paiKoTWC7a/edit?usp=sharing&ouid=11391...

 

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.

Top Solution Authors