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
Anonymous
Not applicable

Filter containing mixed types of data

I have a column that contains both dates and two text values.

I would like to create a filter using this column that would act like a normal "Date" filter. Now when I use this column, it is perceived as a text column and all the dates are sorted in text order, which makes it impossible to use.

 

Could you please provide an idea of how to present this column so it would act as a filter that it is convenient to use.

 

 

 

1 ACCEPTED SOLUTION

HI @Anonymous ,

 

you would need to tackle this with multi slicer setup, since you have a new column in place. you can create one more column with similar function, however, you would replace the outcome as below

 

Column2 = IF(ISERROR(Convert('reporting-usage-rights'[Expiry date - Changed], DATETIME)),
'reporting-usage-rights'[Expiry date - Changed], "Date")

 

you can use this as your primary slicer, while the column you have created earlier will be your secondary slicer, on selection of Date from primary slicer your second slicer will show all the dates. 

 

Thank you,

Washivale

 

View solution in original post

5 REPLIES 5
Washivale
Resolver V
Resolver V

Hi @Anonymous ,

 

You can create a new column from modeling menu with below dax function and use it in your filter

 

Column = IF(ISERROR(CONVERT('Table'[Column1],datetime)),blank(),CONVERT('Table'[Column1],datetime))
 
let me know if it helps.
 
Regards,
Washivale
Anonymous
Not applicable

@Washivale , thank you for the idea.

When I try to use the formula provided, this is what I get:

 

1.JPG

 

I am just trying to understand why I am receiving errors for the Data type?

Hi @Anonymous ,

 

Somehow intellisense shows an error on the data type, I tried finding reason for error on datatype with no luck. However, when you hit enter after adding this function to new column, it does work as expected. 

 

Regards,

Washivale

Anonymous
Not applicable

@Washivale , in my case it did work. However, the text part of the column was converted into blanks, as they are errors. All the rest fields were converted into dates, as expected. 

Thus, by getting blanks, I cannot include the text fields into the filter that I would like to create as a visual.

HI @Anonymous ,

 

you would need to tackle this with multi slicer setup, since you have a new column in place. you can create one more column with similar function, however, you would replace the outcome as below

 

Column2 = IF(ISERROR(Convert('reporting-usage-rights'[Expiry date - Changed], DATETIME)),
'reporting-usage-rights'[Expiry date - Changed], "Date")

 

you can use this as your primary slicer, while the column you have created earlier will be your secondary slicer, on selection of Date from primary slicer your second slicer will show all the dates. 

 

Thank you,

Washivale

 

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.