We're giving away 30 tickets for FREE! Share your story, your vision, or your hustle and tell us why YOU deserve a ticket.
Apply nowWin a FREE 3 Day Ticket to FabCon Vienna. Apply now
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://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.
Solved! Go to Solution.
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 @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.
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
Unfortunately i can't run as your instruction. I have attached both files. Please help to find th ereason.
https://drive.google.com/file/d/1cfi5MVNrHEHpKmLa7R-Z9plkxfeW8qni/view?usp=sharing