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, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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