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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Jannikskak
New Member

Counting reports of clients on in specific group

Hello everybody.

I am quite new to PBI, and I'm trying to get acquinted with the possibilites in Power Query.

I have a dataset of some hundred thousand rows each representing a report made by contractors of different firms. Some of the firms are grouped. 

I wish to count, in a column, the reports by the name having filled out the report on condition of the report being in specific firm groups (GroupO and report classification "Single"). That is, I am in need of af DAX formula quite like the COUNTIFS of Excel. I have tried composing a collumn of the form: 

 

Measure =
CALCULATE(COUNT(Sheet1[Contractor]),
FILTER(ALL(Sheet1),Sheet1[c_firma_navn_aggregeret]="GroupO"),
FILTER(ALL(Sheet1),Sheet1[EM_type]="Single"))
 
This gives me a column of the total of reports satisfying these criteria. The problem is, that i wish to have the total number of reports peformed by each "Contractor[name]", that should give me "0" for contractors not in GroupO.
Does any of you sharp minds know my best of solving this?
 
Thank you very much in advance! 
1 REPLY 1
Manoj_Nair
Solution Supplier
Solution Supplier

@Jannikskak - try this DAX and let me know if this fixes your problem. Many Thanks

Measure = if(Sheet1[c_firma_navn_aggregeret]="GroupO", 
CALCULATE(COUNT(Sheet1[Contractor]),
FILTER(ALL(Sheet1),Sheet1[c_firma_navn_aggregeret]="GroupO"),
FILTER(ALL(Sheet1),Sheet1[EM_type]="Single")),0)

 

Helpful resources

Announcements
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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors