Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi @san_bxl
Your DAX formula has logical flaws that prevent the CALCULATE function from interpreting the conditions as intended. Specifically, the logical OR (||) and AND (&&) operations must be properly nested, and the filter syntax needs to conform to the DAX filter context structure.
Here’s the corrected DAX formula:
M11-2a_Scope =
CALCULATE(
SUM('Project-Resource Assignment'[PlannedUnits]),
ALL('DATE TABLE'),
// Condition 1
OR(
'Project-Resource'[Id] IN {
"C3-GAD-14",
"C3-GAD-12",
"C3-GAD-13",
"C3-GAD-11",
"C3-GAD-2",
"C3-GAD-1",
"C3-GAD-7",
"C3-M-9"
},
// Condition 2 AND Condition 3
AND(
'Project-Resource'[Id] = "C3-M-102",
LEFT('Project-Activity'[Id], 14) = "CM-"
),
AND(
'Project-Resource'[Id] = "C3-M-88",
LEFT('Project-Activity'[Id], 14) = "CM-S3"
)
)
)
This formula should now calculate the sum of PlannedUnits with the specified conditions applied correctly.
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
I am looking for
condition 1 or Condition 2 or Conditon 3
If it satisfies any, its should calculate
Hi @san_bxl ,
You calculation is based on your data model. We need to know the relationship in your report and what your table looks like.
Could you share a sample file with us and then show us a screenshot with the result you want? This will make it easier for us to find the solution.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you try this dax:
M11-2a_Scope =
CALCULATE(
SUM('Project-Resource Assignment'[PlannedUnits]),
ALL('DATE TABLE'),
// Combine Condition 1, 2, and 3 with OR logic
OR(
// Condition 1
'Project-Resource'[Id] IN {
"C3-GAD-14",
"C3-GAD-12",
"C3-GAD-13",
"C3-GAD-11",
"C3-GAD-2",
"C3-GAD-1",
"C3-GAD-7",
"C3-M-9"
},
// Condition 2
AND(
'Project-Resource'[Id] = "C3-M-102",
LEFT('Project-Activity'[Id], 14) = "CM-"
),
// Condition 3
AND(
'Project-Resource'[Id] = "C3-M-88",
LEFT('Project-Activity'[Id], 14) = "CM-S3"
)
)
)
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
In both LEFT functions you are taking 14 characters, I think you meant to only take 4.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
20 | |
14 | |
11 | |
10 | |
10 |