Forum Discussion
Using Slicer end date in Measure
- 1 year ago
Hi DuaneF Try this:
Total_SOH_Selected_Date = CALCULATE( SUM(Artikelbestand[Cost_Total]), FILTER( ALLSELECTED(Artikelbestand), Artikelbestand[Trans_Date] = [LastSelectedDate] ) )Hope this helps!!
If this solved your problem, please accept it as a solution and kudos!!
Best Regards,
Shahariar Hafiz
To make your measure consider only the end date selected in the slicer, you’ll want to reference the last date in the selection range. You can use `MAX` or `LASTDATE` functions to capture the end date from the slicer and then apply it in your calculation. Here’s how you can modify your measure:
DAX
Last_Selected_Date =
MAX('Date'[Trans_Date]) // assuming you are using a date table with 'Date' as the table name and Trans_Date as the date column.
Total_SOH_Selected_Date =
CALCULATE(
SUM(Artikelbestand[Cost_Total]),
Artikelbestand[Trans_Date] = [Last_Selected_Date]
)
Explanation:
1. `Last_Selected_Date` captures the end date from the slicer (the maximum date selected).
2. `Total_SOH_Selected_Date` then uses this date to filter `Artikelbestand[Trans_Date]` to only the end date of your selection, summing `Cost_Total` accordingly.
This should make the measure consider only the end date in your slicer. Let me know if you encounter any issues!
Did I answer your query ? Please mark this as solution . Appreciate your Kudos 🙂