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
Anonymous
Not applicable

Count problem measure

Good morning, everyone,
I am creating a Dax command, which allows calculating the number of category A (which is in the Category column) that have a Success in the Result column. So the result after creating this measure is 4. Here is the illustration to understand more. PS: There are a lot of data like these. 

 

Capture3.PNG

Best regards. Thank you. 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

@Anonymous  - 

If you want it to be specific for Category A, you can create this measure:

Count Success Category A = 
CALCULATE(COUNTROWS(YourTable), YourTable[Category] = "A", YourTable[Result] = "Success")

You could also create your measure to work more generally:

Count Success = 
CALCULATE(COUNTROWS(YourTable), YourTable[Result] = "Success")

Hope this helps,

Nathan

View solution in original post

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

You can use DAX Expression below

 

Measure 4 = 
CALCULATE(
    COUNTROWS( Table ),
    Table[Result] = "Success"
)

Regards,
Mariusz

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

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

You can use DAX Expression below

 

Measure 4 = 
CALCULATE(
    COUNTROWS( Table ),
    Table[Result] = "Success"
)

Regards,
Mariusz

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

Anonymous
Not applicable

@Anonymous  - 

If you want it to be specific for Category A, you can create this measure:

Count Success Category A = 
CALCULATE(COUNTROWS(YourTable), YourTable[Category] = "A", YourTable[Result] = "Success")

You could also create your measure to work more generally:

Count Success = 
CALCULATE(COUNTROWS(YourTable), YourTable[Result] = "Success")

Hope this helps,

Nathan

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.