Reply
insandur
Helper II
Helper II

Incompatible types for comparison - Date,Text in dropdown items power apps

Hi ,

 

I have a sharepoint column (Date column) and when using it in the dropdown value.

 

When i goto items and add filter   Date =  dropdown.selected.Value i get a error   

"Incompatible types for comparison - Date,Text"  .  

1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

I see that you are trying to compare a date value with a text value and since your SharePoint column is a date type and the dropdown returns a text value (dropdown.selected.Value), you need to either convert the text to a date or the date to a text, depending on your needs.

 

You can use the DateValue function to convert the text value from the dropdown to a date format before comparing it with your SharePoint date column.

 

Filter(
    YourSharePointList,
    DateColumn = DateValue(Dropdown.Selected.Value)
)

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

3 REPLIES 3
AmiraBedh
Super User
Super User

I see that you are trying to compare a date value with a text value and since your SharePoint column is a date type and the dropdown returns a text value (dropdown.selected.Value), you need to either convert the text to a date or the date to a text, depending on your needs.

 

You can use the DateValue function to convert the text value from the dropdown to a date format before comparing it with your SharePoint date column.

 

Filter(
    YourSharePointList,
    DateColumn = DateValue(Dropdown.Selected.Value)
)

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Thank You Amira,

 

It worked well without error in Items, However i get error in my collect variable for that Date column collection

insandur_0-1729229104338.png

 

what do you want to achieve here ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)