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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
SBoyd
New Member

Fairly new to Dax - Count Question

Hello,

 

I am fairly new to Dax and find myself stuck.  I have data as below in the table with a Case Number where there are individual Tasks associated with that Case.  I need to do a couple of things, but believe they are all related in the Dax necessary to get my results.

 

I would like to create a new Column and count the number of times a Case Number has a Task = 1 and the Group = Team 1.  I'm able to get a result for that specific row of 1, but would like that result of 1 to appear on the rows having Task = 2 or 3 or beyond.

 

When I use:

 

My Team = CALCULATE(
COUNTROWS('Table Name'),'Table Name'[Case Number],'Table Name'[Group]="Team 1")
 
I get a 1 in the row where the Group = "Team 1".  However, the 4 rows below with the same Case Number (= 100) are blank and I would like to have the result return 1 on those rows as well.
 
SBoyd_0-1635875687534.png

 


 

Thank you.

1 ACCEPTED SOLUTION
ERD
Super User
Super User

Hi @SBoyd ,

You can try this:

My Team =
CALCULATE (
    COUNTROWS ( 'Table Name' ),
    'Table Name'[Task] = 1,
    'Table Name'[Group] = "Team 1",
    ALLEXCEPT('Table Name','Table Name'[Case Number])
)

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

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

View solution in original post

2 REPLIES 2
SBoyd
New Member

Yes, thank you!  Looks like I need to read up on ALLEXCEPT. 

 

Appreciate the feedback and help!

ERD
Super User
Super User

Hi @SBoyd ,

You can try this:

My Team =
CALCULATE (
    COUNTROWS ( 'Table Name' ),
    'Table Name'[Task] = 1,
    'Table Name'[Group] = "Team 1",
    ALLEXCEPT('Table Name','Table Name'[Case Number])
)

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

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors