Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filter on multiple columns in a measure

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]
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Anonymous 

try like:

OverdueProjects =
COUNTROWS(

    FILTER(Projects,
Projects[ProjectStatus] = "Done"
&& [TimeDiff] < 0
))

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @Anonymous 

try like:

OverdueProjects =
COUNTROWS(

    FILTER(Projects,
Projects[ProjectStatus] = "Done"
&& [TimeDiff] < 0
))

Anonymous
Not applicable

Thanks very much!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.