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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Convert YYYYMMDD calculated column into measure to use in slicer

Hi

I am working with a direct query model and can only create measures. I have a calculated column FK in the model (Account Creation Date) that is in the format YYYYMMDD. I need to create a measure from this object and then use it in a slicer as a single button that will restrict any associated visual from 01/01/2021. Any help appreciated!

Thanks.

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

PowerBI doesn't support applying a measure field to the slicer.You need to drag a actual column field to the slicer.

 

Since you are using the directquery connection mode, calculated columns are not supported. 

As a workaround, you can try to create a calculated table  and format the date  field in  this calendar table.

 

Calendartable = CALENDAR(DATE(2021,01,01),DATE(2022,01,01))

 

After build  relationships between original table 1[Date] and calendartable[Date] ,you can use the calendartable[Date] to filter the original table.

 

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@Anonymous , you can join with a date table having such a key and work. You can that date table in power bi

 

refer: https://www.youtube.com/watch?v=cQfJ0GmQ5os&list=PLPaNVDMhUXGbKatyDdOhGbTL3xW2Xy6pA&index=7

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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