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

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.

Reply
amotto11
Helper II
Helper II

Countifs Function

Hello, I am pretty new to PowerBI, and I am trying to write a DAX expression for a column that would use Excel's version of countifs. Below is my data, the final column would be the output. The formula i am using in excel to acheive column 3 is COUNTIFS($A$2:$A$13,A2,$B$2:$B$13,1). Can someone help me build this column in PowerBI with DAX? Basically i am trying to create a filter that gives me only the quotes with companyid 1 included. Thanks in advance.

 

QuoteID       CompanyID          CalculatedColumn

60525                    1                                1

60525                  1245                            1

60525                  1375                            1

60525                  1475                            1

223877                1245                            0

223877                1375                            0

223877                1475                            0

223877                1758                            0

223877                1968                            0

458623                1968                            1

458623                    1                              1

458623                 1275                           1

458623                 1258                           1

458623                 1678                           1

1 ACCEPTED SOLUTION

I was able to get it. The table i created was from the following formula, then i just linked it to my existing table and created a slicer on the QuoteID and selected all except blank. Thank you for your help!

 

=DISTINCT(FILTER(table,table[CompanyID]=1))

View solution in original post

14 REPLIES 14

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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