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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mwadhwani
Kudo Kingpin
Kudo Kingpin

Capture Date Range (Slicer: Relative) 1st and last date using DAX

 

Hi Experts,

My report has following visual (Slicer : Relative). If I select last 2 months it shows the range at bottom of visul. I want to place this selected range from visual parallel to it. I guess we might achieve this solution using DAX. Below is the screenshot for reference: 

 

Capture.PNG

 

I tried using following DAX : 

Measure = IF(ISFILTERED(d_Date[Data View Range]),CONCATENATEX(VALUES(d_Date[Data View Range]),d_Date[Data View Range]),"")

 

And display this above measure on Card Visualization. But it shows all the values (means all 60 dates).

I want only the 1st and the last value displayed using DAX. I am close to the solution but not upto it.

 

Can someone suggest or help me with this query.

 

Thanks in Advance..!!

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@mwadhwani,

You can directly create the following two measures.

minselecteddate = MIN(d_Date[Data View Range])
maxselecteddate = MAX(d_Date[Data View Range])

Here is an example for your reference.

1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

how to take the values before min and after max

 

v-yuezhe-msft
Employee
Employee

@mwadhwani,

You can directly create the following two measures.

minselecteddate = MIN(d_Date[Data View Range])
maxselecteddate = MAX(d_Date[Data View Range])

Here is an example for your reference.

1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-yuezhe-msft it worked...!!!!. I was thinking alot so created very complex DAX

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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