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 am new to DAX and appreciate your patience if this is a mundane question. Thank you in advance.
I'm writing two measures, one to filter for projects that were overdue when completed, and one to filter for projects completed before their deadline. These measures will be used to create a stacked column chart of projects completed each quarter throughout the year.
I will use the example of overdue projects. This is my measure:
OverdueProjects =
FILTER(Projects,
Projects[ProjectStatus] = "Done"
&& Projects[TimeDiff] < 0
)
I get the error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
In this example, Projects[TimeDiff] refers to another measure that is calculating the difference between the promised execution time for the project, and the actual execution time, so if TimeDiff is negative, it indicates the project is late. I'm not sure if referring to another measure might be what is causing the issue.
Code to evaluate TimeDiff:
Time Promised =
--Time between date created and promise date
CALCULATE(
INT(
SUMX(Projects, Projects[PromiseDate] - Projects[StartDate])
),
Projects[ProjectStatus] = "Done"
&& Projects[PromiseDate] <> BLANK()
)
Time Delivered =
-- Time between date created and date completed
CALCULATE(
INT(
SUMX(Projects, Projects[DoneDate] - Projects[StartDate])
),
Projects[ProjectStatus] = "Done"
)
TimeDiff = [Time Promised] - [Time Delivered]
Solved! Go to Solution.
hi @eloomis
try like:
OverdueProjects =
COUNTROWS(
FILTER(Projects,
Projects[ProjectStatus] = "Done"
&& [TimeDiff] < 0
))
hi @eloomis
try like:
OverdueProjects =
COUNTROWS(
FILTER(Projects,
Projects[ProjectStatus] = "Done"
&& [TimeDiff] < 0
))
Thanks very much!
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 |
---|---|
51 | |
27 | |
24 | |
13 | |
8 |
User | Count |
---|---|
74 | |
52 | |
47 | |
16 | |
12 |