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
admin_xlsior
Post Prodigy
Post Prodigy

Calculated column

Hi guys,

 

If I have a slicer, for example Date, and when we select some date, can we put the value of it in some table as a calculated column.

So when I have a slicer based on my DimDate dimension, I may create a measure "Selected date = SELECTEDVALUE(DimDate[Date])"

Lets say I have a table:

ItemCreateDate
ItemA10/1/2019
ItemB10/2/2019

 

So I want to add a calculated column with the value of SelectedDate on each row of my table.

 

Thanks,

 

1 ACCEPTED SOLUTION

Hi @admin_xlsior ,

 

The max function should work fine as following, the selectvalue function may return value if you select multi dates.

 

15.PNG

 

If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.

 


BTW, pbix as attached.

 

Best regards,

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

Community Support Team _ Dong Li
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

5 REPLIES 5
v-lid-msft
Community Support
Community Support

Hi @admin_xlsior ,


How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

 

Best regards,

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

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

Hi,

 

Sorry, yes it works.

 

Thanks

v-lid-msft
Community Support
Community Support

Hi @admin_xlsior ,

 

The measure is dynamic but the calculated columns are computed during the database processing and then stored in the model. So In your scenario, we connot put the value of slicer in some table as a calculated column.

 

Best regards,

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

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

Hi,

 

How about measure, can I use measure ? 

I've created something like "ChosenDate = SELECTEDVALUE(Date[Date]), and put the measure in table visual with my transaction data, but it is empty

 

If I'm using MAX(Date[Date]) it will be the latest date in the dimension, not the one I select in the slicer.

 

Thanks,

Hi @admin_xlsior ,

 

The max function should work fine as following, the selectvalue function may return value if you select multi dates.

 

15.PNG

 

If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.

 


BTW, pbix as attached.

 

Best regards,

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

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

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.