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
ephramz
Helper II
Helper II

Need help with a simple DAX function, to count data occurence

Hi, i'm new to PowerBI and i'm working on an automation process and i'm facing difficulties with PowerBI from converting over from excel. I was just wondering,
How do I create a new column(new DAX function), such that it give me the (count) by checking two column(s) of data row by row.

 

For example under the Op.No. Column and  Equipment column,

I want to count how many rows have this Op No. "9990" and Equipment column "243719208" value

For this case it should reflect as 2

Thanks!! Help is really appreciated!!

Capture.PNG

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @ephramz 

 

Try to add a new column with this DAX code:

 

new column =
CALCULATE (
    COUNTROWS ( 'Table' ),
    ALLEXCEPT ( 'Table', 'Table'[Op.No.], 'Table'[Equipment] )
)

 

 

Output:

VahidDM_0-1630556679705.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Appreciate your Kudos VahidDM_1-1630556714329.png !!

 

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @ephramz 

 

Try to add a new column with this DAX code:

 

new column =
CALCULATE (
    COUNTROWS ( 'Table' ),
    ALLEXCEPT ( 'Table', 'Table'[Op.No.], 'Table'[Equipment] )
)

 

 

Output:

VahidDM_0-1630556679705.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Appreciate your Kudos VahidDM_1-1630556714329.png !!

 

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.