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

Join 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.

Reply
DuaneF
New Member

Using Slicer end date in Measure

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

 

Total_SOH_Selected_Date =
calculate(
    sum(Artikelbestand[Cost_Total]),
    Filter(
        allselected(Artikelbestand[Trans_Date]),
        'Measure'[Last Selected Date])
    )
1 ACCEPTED SOLUTION
shafiz_p
Super User
Super User

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

View solution in original post

2 REPLIES 2
FarhanJeelani
Super User
Super User

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 🙂

shafiz_p
Super User
Super User

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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