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
ggzmorsh
Helper II
Helper II

Return value of selected date from a drop down slicer

I need to get the selected date from a drop down slicer from a date table that does not have relationships to any tables. The selected date is then put to a new column. I tried using selectedvalue and it only returns blanks.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Let us assume you want to show the date on cart

 

Measure =

Var _max =Maxx(Date,allselected(Date[Date]))

Return

_max

 

You want sales from the sales table

 

Measure =

Var _max =Maxx(Date,allselected(Date[Date]))

Return

calculate(sum(sales[value]),sale[date]=_max)

 

Please put up an example of what you need.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

View solution in original post

3 REPLIES 3
ggzmorsh
Helper II
Helper II

Thank you for the quick response.

 

You are correct Mr. Felix, i did not tried that procedure which is returning blanks on the custom column.

 

Measure =

Var _max =Maxx(Date,allselected(Date[Date]))

Return

_max

 

@amitchandak solution solved my problem. 

amitchandak
Super User
Super User

Let us assume you want to show the date on cart

 

Measure =

Var _max =Maxx(Date,allselected(Date[Date]))

Return

_max

 

You want sales from the sales table

 

Measure =

Var _max =Maxx(Date,allselected(Date[Date]))

Return

calculate(sum(sales[value]),sale[date]=_max)

 

Please put up an example of what you need.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

MFelix
Super User
Super User

Hi @ggzmorsh ,

 

You cannot get data from a slicer into a calculated column you need to use a measure in order to get the calculations you need.

 

So the selectedvalue is the correct formula however that needs to be used in a measure. What is the calculation you are trying to achieve in the calculated column?

 

Can you share a mockup data so I can assist you better.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.