cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors