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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
daviss62
Frequent Visitor

NOT function with list of values

I have the following formula that calculated column for the number of courses completed by students.

 

WW Completed Courses =
SUMMARIZE(
    'WW Registrations',
    [Student ID],
    [Academic Year],
    [Academic Year End Academic Career],
    [Academic Year End Academic Plan No Roll-up Description],
    [Gender Description],
    [Age Groups],
    [Age],
    [Ethnicity (IPEDS)],
    "Completed Courses", COUNTA('WW Registrations'[Student ID]))

 

However, I now want to update the measure to exclude courses where the 'Course Grade Official' value is I, IP, N, T, W or (blank). I wasn't sure what the best way to include this into the measure (i.e. as an IF statement or as a filter). I tried using the "NOT" function in the formula, but received a syntax error. I hadn't found many examples of how to list multiple values within a NOT function.

 

Any assistance would be greatly appreciated! Thanks.

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @daviss62,

 

You can direct add filters on table to filter records:

WW Completed Courses =
SUMMARIZE (
    FILTER (
        ALL ( 'WW Registrations' ),
        NOT (
            'WW Registrations'[Course Grade Official]
                IN { "I", "IP", "N", "T", "W", BLANK () }
        )
    ),
    [Student ID],
    [Academic Year],
    [Academic Year End Academic Career],
    [Academic Year End Academic Plan No Roll-up Description],
    [Gender Description],
    [Age Groups],
    [Age],
    [Ethnicity (IPEDS)],
    "Completed Courses", COUNTA ( 'WW Registrations'[Student ID] )
)

Regareds,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @daviss62,

 

You can direct add filters on table to filter records:

WW Completed Courses =
SUMMARIZE (
    FILTER (
        ALL ( 'WW Registrations' ),
        NOT (
            'WW Registrations'[Course Grade Official]
                IN { "I", "IP", "N", "T", "W", BLANK () }
        )
    ),
    [Student ID],
    [Academic Year],
    [Academic Year End Academic Career],
    [Academic Year End Academic Plan No Roll-up Description],
    [Gender Description],
    [Age Groups],
    [Age],
    [Ethnicity (IPEDS)],
    "Completed Courses", COUNTA ( 'WW Registrations'[Student ID] )
)

Regareds,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi Xiaoxin,

 

Thanks for your response! When I try using the formula, I get the following error message:

 

"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

 

I'm not quite sure what the fix is. Is this something you can help me with?

 

Thanks,

Sean

Hi @daviss62,

 

My formula is for calculated table, please use it as new table.

 

Regards.

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft

 

I actually realized that yesterday afternoon. I must have accidentally clicked "New Measure" instead of "New Table".

 

Thanks again for your assistance!

 

Sean

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.