The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello, please can someone explain why these two measures produce different results (something to do with the AND/OR but I don't understand why these would differ)? (I am reposting this as I made an error in my original post)
measure 1 check (no.) =
CALCULATE (
COUNT ( fct_core[colour] ),
fct_core[type] = 1
|| fct_core[type] = 2
|| fct_core[type] = 3
&& fct_core[colour] = 5
|| fct_core[colour] = 6
|| fct_core[colour] = 7
|| fct_core[colour] = 8
)
and:
measure 2 check (no.) =
CALCULATE (
COUNT ( fct_core[colour] ),
fct_core[type] >= 1
&& fct_core[type] <= 3
&& fct_core[colour] = 5
|| fct_core[colour] = 6
|| fct_core[colour] = 7
|| fct_core[colour] = 8
)
thanks,
A
Solved! Go to Solution.
Suppose you have type 2 and color 4. Then measure 1 would count it but not measure 2.
Note that your logical combination
T1 || T2 || T3 && C5 || C6 || C7 || C8
is equivalent to
T1 || T2 || (T3 && C5) || C6 || C7 || C8
not as I think you intended
(T1 || T2 || T3) && (C5 || C6 || C7 || C8)
I'd rewrite the measure as
check (no.) =
CALCULATE (
COUNT ( fct_core[colour] ),
fct_core[type] IN { 1, 2, 3 },
fct_core[colour] IN { 5, 6, 7, 8 }
)
Suppose you have type 2 and color 4. Then measure 1 would count it but not measure 2.
Note that your logical combination
T1 || T2 || T3 && C5 || C6 || C7 || C8
is equivalent to
T1 || T2 || (T3 && C5) || C6 || C7 || C8
not as I think you intended
(T1 || T2 || T3) && (C5 || C6 || C7 || C8)
I'd rewrite the measure as
check (no.) =
CALCULATE (
COUNT ( fct_core[colour] ),
fct_core[type] IN { 1, 2, 3 },
fct_core[colour] IN { 5, 6, 7, 8 }
)
That is really helpful, thanks Alexis and for stackoverflow too!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
83 | |
72 | |
49 | |
41 |
User | Count |
---|---|
139 | |
113 | |
74 | |
64 | |
63 |