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.
Hi,
I am getting below error message when I use the measure,
"Cannot Convert value of type text to type True/False"
I have 2 calculated fields, 1 New column and 1 new measure as below
New Column:
Volume_Cal = IF(TRIM('Orders'[DOCUMENTID])="Not MVI",'Orders'[ACCOUNTID],'Orders'[DOCUMENTID])
Data Type: Text
New Measure:
Volume = CALCULATE(DISTINCTCOUNT('Orders'[Volume_Cal]),FILTER('Orders','Orders'[PROCESS] in {"Posted","Credit", "Open Items"} && ('Orders'[DOCUMENTTYPE] = "AB" || (TRIM(NOT('Orders'[DOCUMENTSTATUS])) in {"Ready Validation", "Not MVI"} || ISBLANK(TRIM('Orders'[DOCUMENTSTATUS]))) && 'Orders'[Open Status] ="In Process")))
Data Type: Whole Number
The column value looks good, but the measure value is throwing an error as mentioned.
Similar kind of calculations I have used before but I never get such error.
Can anayone help me in resolving this issue.
A quick help would be much appreciated.
Solved! Go to Solution.
Hi @Anonymous
I think it may be the position of your NOT function which is causing the problem.
Try this instead (not tested):
Volume =
CALCULATE(
DISTINCTCOUNT( 'Orders'[Volume_Cal] ),
FILTER(
'Orders',
'Orders'[PROCESS] IN { "Posted", "Credit", "Open Items" }
&& (
'Orders'[DOCUMENTTYPE] = "AB"
|| (
NOT ( TRIM( 'Orders'[DOCUMENTSTATUS] ) IN { "Ready Validation", "Not MVI" } )
|| ISBLANK( TRIM( 'Orders'[DOCUMENTSTATUS] ) )
)
&& 'Orders'[Open Status] = "In Process"
)
)
)
Best regards,
Martyn
If I answered your question, please help others by accepting it as a solution.
I doubt the position of not, check and try
Volume = CALCULATE(DISTINCTCOUNT('Orders'[Volume_Cal])
,FILTER('Orders',
'Orders'[PROCESS] in {"Posted","Credit", "Open Items"}
&& ('Orders'[DOCUMENTTYPE] = "AB"
|| (NOT(TRIM(('Orders'[DOCUMENTSTATUS])) in {"Ready Validation", "Not MVI"} )
|| ISBLANK(TRIM('Orders'[DOCUMENTSTATUS])))
&& 'Orders'[Open Status] ="In Process")))
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
I doubt the position of not, check and try
Volume = CALCULATE(DISTINCTCOUNT('Orders'[Volume_Cal])
,FILTER('Orders',
'Orders'[PROCESS] in {"Posted","Credit", "Open Items"}
&& ('Orders'[DOCUMENTTYPE] = "AB"
|| (NOT(TRIM(('Orders'[DOCUMENTSTATUS])) in {"Ready Validation", "Not MVI"} )
|| ISBLANK(TRIM('Orders'[DOCUMENTSTATUS])))
&& 'Orders'[Open Status] ="In Process")))
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Hi @Anonymous
I think it may be the position of your NOT function which is causing the problem.
Try this instead (not tested):
Volume =
CALCULATE(
DISTINCTCOUNT( 'Orders'[Volume_Cal] ),
FILTER(
'Orders',
'Orders'[PROCESS] IN { "Posted", "Credit", "Open Items" }
&& (
'Orders'[DOCUMENTTYPE] = "AB"
|| (
NOT ( TRIM( 'Orders'[DOCUMENTSTATUS] ) IN { "Ready Validation", "Not MVI" } )
|| ISBLANK( TRIM( 'Orders'[DOCUMENTSTATUS] ) )
)
&& 'Orders'[Open Status] = "In Process"
)
)
)
Best regards,
Martyn
If I answered your question, please help others by accepting it as a solution.
Thanks a lot.
You are correct. "NOT" function is causing the issue.
Now I have changed it to NOT(TRIM( 'ORDERS' [DOCUMENTSTATUS])).
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |