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.
I'm trying to count rows from a text column with 2 filters that check another 2 int columns with values that are not 0, but it fails.
MSErrorsT = COUNTROWS(FILTER('datafsa list_sessions','datafsa list_sessions'[# Errors] <> "0" && 'datafsa list_sessions'[# Warnings] <> "0"))
MdxScript(Model) (5, 84) Calculation error in measure 'datafsa list_sessions'[MSErrorsT]: DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
I've tried to do it with cards, but if I place 2 filters in the same card, only one works.
If i place the filters separately, it works, but when i add the other one it only applies the first one.
Isn't it possible to apply 2 column filters in the same card?
Solved! Go to Solution.
Hi, @mcflurry
According to your description, I can roughly understand your requirement, it seems that you want to get the sum value of the count of the errors and warnings, right?
If so, I think defining the variables in the measure can help, you can try to modify the measure like this:
MSErrorsT =
Var _Errors=
CALCULATE(
COUNTROWS( 'datafsa list_sessions' ),
FILTER(
'datafsa list_sessions',
'datafsa list_sessions'[# Errors] <> 0
)
)
Var _Warnings=
CALCULATE(
COUNTROWS( 'datafsa list_sessions' ),
FILTER(
'datafsa list_sessions',
'datafsa list_sessions'[# Warnings] <> 0
)
)
RETURN
_Errors+_Warnings
And you can check if you can get what you want.
If not, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @mcflurry
According to your description, I can roughly understand your requirement, it seems that you want to get the sum value of the count of the errors and warnings, right?
If so, I think defining the variables in the measure can help, you can try to modify the measure like this:
MSErrorsT =
Var _Errors=
CALCULATE(
COUNTROWS( 'datafsa list_sessions' ),
FILTER(
'datafsa list_sessions',
'datafsa list_sessions'[# Errors] <> 0
)
)
Var _Warnings=
CALCULATE(
COUNTROWS( 'datafsa list_sessions' ),
FILTER(
'datafsa list_sessions',
'datafsa list_sessions'[# Warnings] <> 0
)
)
RETURN
_Errors+_Warnings
And you can check if you can get what you want.
If not, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey @mcflurry ,
maybe try to filter for numbers (<> 0 ) and not string (<> "0"):
MSErrorsT = COUNTROWS(FILTER('datafsa list_sessions','datafsa list_sessions'[# Errors] <> 0 && 'datafsa list_sessions'[# Warnings] <> 0))
Hey @selimovd ,
It does exactly the same as with card filters.
First filter result is 8, and second one is 260, it should be 268.
But result is 8.
Hey @mcflurry ,
but you don't get an error anymore?
I think I was too focuses on the error and not on the measure 😉.
Try the following measure:
MSErrorsT =
CALCULATE(
COUNTROWS( 'datafsa list_sessions' ),
FILTER(
'datafsa list_sessions',
'datafsa list_sessions'[# Errors] <> 0 && 'datafsa list_sessions'[# Warnings] <> 0
)
)
Hey @selimovd ,
Yep, sorry, without the quotes it worked.
But it still shows just the alerts, it doesn't sum the warnings. Result is still 8.
It works if i create 3 measures.
1 for warnings, result=260
1 for errors, result=8
1 for total error+warnings = 268
Isn't that possible with 1 single measure?
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |