Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I'm new to Power BI, and still learning. I have created a measure to determine the last selected date from my date slicer. I want to use this date to determine the date that must be used in a sum query. The measure keeps ons selecting all the date ranges, and not just the end date of the slicer. Please can someone help me
Solved! Go to Solution.
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 🙂
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |