cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KarenKazab
Frequent Visitor

Dax formula help - count rows with multiple values in one column

Hi all,

 

Relatively new to power bi and Dax and i'm sure this is probably an easy one, in sql would be a doddle, i want to count the rows in my table CurrentOccupants where the column OccupancyStatus is equal to Lead and Joint so something like:

 

No' Tenants = COUNTROWS(FILTER('CurrentOccupants','CurrentOccupants'[OccupancyStatus] = "Lead","Joint"))

 

I've tried searching and cant seem to find a solution to this.

 

Many thanks 

 

Karen

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @KarenKazab 

 

No' Tenants =
COUNTROWS (
    FILTER (
        'CurrentOccupants',
        'CurrentOccupants'[OccupancyStatus] IN { "Lead", "Joint" }
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

Hi @KarenKazab 

 

No' Tenants =
COUNTROWS (
    FILTER (
        'CurrentOccupants',
        'CurrentOccupants'[OccupancyStatus] IN { "Lead", "Joint" }
    )
)

Regards
Zubair

Please try my custom visuals

Hi Zubair,

 

I tried your solution but received syntax error. May i know what could be wrong? I'm newbie in DAX PBI. Appreciate your help on this. Thanks!

 

Total Submission = CALCULATE (COUNTROWS ( node__field_state ), node__field_state[field_state_value IN { "processing","accepted","draft","rejected" }))

Thanks @Zubair_Muhammad  you're a star. So easy when you think about it.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors