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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
IzuruWi
Frequent Visitor

Unable to fetch the selected date in Slicer

Hi All,
I need to fetch the "Start Date" in the slicer, to calculate the "End Date" of the slicer. (which should be the date of 3 months from the "Start Date". I will be using the DateAdd function for that.) Also, "End Date " is essential to calculate using that date. 

Here I have highlighted the start date of the slicer which I need to be extracted.

IzuruWi_0-1675851430834.png


I have used below mentioned DAX to pull, but no luck with that. I'll be grateful If someone can give me a helping hand with this.

 

Date Selected =
CALCULATE ( MIN ( INFO_TABLE[START_DATE] ) )

 

Thanks

 
2 REPLIES 2
jaweher899
Super User
Super User

To get the "Start Date" from the slicer in PowerBI, you can use the following DAX expression:

Start Date = MIN(INFO_TABLE[START_DATE])

This expression will give you the minimum date selected in the slicer for the "Start Date" column in the INFO_TABLE.

To calculate the "End Date" using the "Start Date", you can use the DateAdd function as follows:

End Date = DateAdd(Start Date, 3, "Month")

This will give you the date that is 3 months from the selected "Start Date".

Hi @jaweher899 

I have used that method to fetch the "Start Date". But still, the result is similar to the previous one.

Btw, the "End Date" calculation works fine. Thank you very much for that.

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.