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
manjarigoyal
Frequent Visitor

How to Convert the date column to text and Integer column to Text when using filters in DAX?

I want to count the total number of sites where Aging is greater than 90 days and Sliped date is NOT BLANK. The data type of Sliped Date is DATE and Aging is INTEGER type. I tried to use the formula below but I am getting the error "MdxScript(Model) (30, 195) Calculation error in measure 'CSR Swap Request Status'[> 90 Days]: DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values."
 
90 Days =
CALCULATE(COUNTA('CSR Swap Request Status'[Site ID]),FILTER('CSR Swap Request Status',FORMAT('CSR Swap Request Status'[Sliped Date],"mm/dd/yyyy") <> ""), FILTER('CSR Swap Request Status',FORMAT('CSR Swap Request Status'[Aging] > 90,"General Number")))
1 ACCEPTED SOLUTION

@manjarigoyal , I doubt Aging is int or whole number then , try this

 

90 Days =
CALCULATE(COUNTA('CSR Swap Request Status'[Site ID]),FILTER('CSR Swap Request Status', not(isblank('CSR Swap Request Status'[Sliped Date])) && 'CSR Swap Request Status'[Aging] > "90"))

 

Can you share  a sample pbix after removing sensitive data.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@manjarigoyal , Try like

 

90 Days =
CALCULATE(COUNTA('CSR Swap Request Status'[Site ID]),FILTER('CSR Swap Request Status', not(isblank('CSR Swap Request Status'[Sliped Date])) && 'CSR Swap Request Status'[Aging] > 90))

@amitchandak I am still getting the same error

@manjarigoyal , I doubt Aging is int or whole number then , try this

 

90 Days =
CALCULATE(COUNTA('CSR Swap Request Status'[Site ID]),FILTER('CSR Swap Request Status', not(isblank('CSR Swap Request Status'[Sliped Date])) && 'CSR Swap Request Status'[Aging] > "90"))

 

Can you share  a sample pbix after removing sensitive data.

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.