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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ODeb
Regular Visitor

Count of jobs when country and client is selected

Can anyone help me with dax for total count of jobs when company and client is selected in slicer . I have job table with job number column , company table with company name column and client table with client name .All the dimensions tables are related to job actual fact table by job key , company key and client key 

1 ACCEPTED SOLUTION
v-jianpeng-msft
Community Support
Community Support

Thank you DataNinja777 

Hi, @ODeb 

Based on your description, I've created this sample dataset below:

vjianpengmsft_0-1737955142876.png

Use two dimension tables to build two slicers:

vjianpengmsft_1-1737955212005.png

Establish the following measure:

Jobs Count = 
CALCULATE(
    COUNT('Job'[Job Number]),
    ALLSELECTED('Company'[Company Name]),
    ALLSELECTED('Client'[Client Name])
)

Here are the results:

vjianpengmsft_2-1737955330977.png

vjianpengmsft_3-1737955364556.png

I've provided the PBIX file used this time below.

 

 

Best Regards

Jianpeng Li

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

3 REPLIES 3
v-jianpeng-msft
Community Support
Community Support

Thank you DataNinja777 

Hi, @ODeb 

Based on your description, I've created this sample dataset below:

vjianpengmsft_0-1737955142876.png

Use two dimension tables to build two slicers:

vjianpengmsft_1-1737955212005.png

Establish the following measure:

Jobs Count = 
CALCULATE(
    COUNT('Job'[Job Number]),
    ALLSELECTED('Company'[Company Name]),
    ALLSELECTED('Client'[Client Name])
)

Here are the results:

vjianpengmsft_2-1737955330977.png

vjianpengmsft_3-1737955364556.png

I've provided the PBIX file used this time below.

 

 

Best Regards

Jianpeng Li

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

 

 

 

 

ODeb
Regular Visitor

Job , Company and client are the dimensions Job Actual table is the fact table and connected by respective keys  to dimension table ..

DataNinja777
Super User
Super User

Hi @ODeb ,

 

To calculate the total count of jobs when a company and client are selected in slicers, you can create a DAX measure that respects the filters applied by these slicers. Given your data model, where the Job Table is related to the Company Table and Client Table via their respective keys (Job Key, Company Key, and Client Key), the measure can be written to count the rows in the Job Table that remain after applying the slicer filters.

The DAX measure for this can be written as:

Total Jobs = COUNTROWS('Job Table')

This measure counts the number of rows in the Job Table. The slicers, placed on Company Name (from the Company Table) and Client Name (from the Client Table), automatically filter the data model. These filters propagate through the relationships to the Job Table, ensuring that only the relevant rows corresponding to the selected company and client are included in the count.

To implement this, ensure that your relationships between the tables are correctly defined in the model. Once the measure is created, you can add it to a card visual or any other visual in Power BI to display the total count of jobs based on the slicer selections. 

 

Best regards,

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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