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

View all the Fabric Data Days sessions on demand. View schedule

Reply
RichOB
Post Partisan
Post Partisan

Need help adding a category to my existing measure

I have 2 tables, 1 which has the contractor and job number. The other has the job number and maintenance status. My end goal is splitting the contractors up by indoor nad outdoor contractors and makign %'s of "Completed - Within Target" and "Completed - Out of Target.

 

I have made a relationship between the job numbers and added a measure to separate the statuses tht takes into consideration the date range I need:

Completed_within_total = (
    CALCULATE(
        Count('Table''[Job_Number]),
        KEEPFILTERS('Table'[Status] IN {"Completed - within target"}),
        'Table'[Date_Completed]>=DATE(2018,4,1),
        'Table'[Date_Completed]<=Date(2025,3,31)
    ))

 

How do I add in the contractos below to get two different %'s for Indoro and Outdoor? (Tables Below)

 

Indoor Contractors:

- Jones Plumber

- North Heating

- Smith Electrician

 

Outdoor Contractors

- Davis Roofing

- Mark Gutters

 

Job_NumberStatusDate_Completed
1Completed - Within target01/01/2017
2Completed - Within target02/01/2018
3Completed - Outside of target03/01/2018
4Completed - Outside of target04/01/2018
5Completed - Outside of target05/01/2018
6Completed - Within target06/01/2019
7Completed - Outside of target07/01/2019
8Completed - Within target08/01/2020
9Completed - Outside of target09/01/2020
10Completed - Outside of target10/01/2021
11Completed - Within target11/01/2021
12Completed - Outside of target12/01/2022
13Completed - Outside of target13/01/2023
14Completed - Within target14/01/2023
15Completed - Within target15/01/2023
16Completed - Within target16/01/2024
17Completed - Outside of target17/01/2024
18Completed - Within target18/01/2024
19Completed - Outside of target19/01/2024
20Completed - Outside of target

20/01/2024

 

 

Contractor Job_Number
Jones Plumber1
Jones Plumber2
Jones Plumber3
North Heating4
North Heating5
North Heating6
North Heating7
Smith Electrician8
Smith Electrician9
Smith Electrician10
Jones Plumber11
Jones Plumber12
Jones Plumber13
Jones Plumber14
Davis Roofing15
Davis Roofing16
Davis Roofing17
Mark Gutters18
Mark Gutters19
Mark Gutters20

 

Thanks in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @RichOB 

I am glad to help you.

 

It is assumed that you have already created this Measure:

Completed_within_total = 
    CALCULATE(
        COUNT('Table'[Job_Number]),
        KEEPFILTERS('Table'[Status] = "Completed - Within target"),
        'Table'[Date_Completed] >= DATE(2018,4,1),
        'Table'[Date_Completed] <= DATE(2025,3,31)
    )

 

Please create three Measures based on the following DAX formulas and I hope they do help you:
Total_Jobs:

Total_Jobs = COUNT('Table'[Job_Number])


Indoor_Completed_Percentage:

Indoor_Completed_Percentage = 
    CALCULATE(
        [Completed_within_total],
        FILTER(
            'ContractorTable',
            'ContractorTable'[Contractor] IN {"Jones Plumber", "North Heating", "Smith Electrician"}
        )
    ) / CALCULATE(
            [Total_Jobs],
            FILTER(
                'ContractorTable',
                'ContractorTable'[Contractor] IN {"Jones Plumber", "North Heating", "Smith Electrician"}
            )
         )


Outdoor_Completed_Percentage:

Outdoor_Completed_Percentage = 
    CALCULATE(
        [Completed_within_total],
        FILTER(
            'ContractorTable',
            'ContractorTable'[Contractor] IN {"Davis Roofing", "Mark Gutters"}
        )
    ) / CALCULATE(
            [Total_Jobs],
            FILTER(
                'ContractorTable',
                'ContractorTable'[Contractor] IN {"Davis Roofing", "Mark Gutters"}
            )
         )

 

Output:

vfenlingmsft_0-1739759211313.png

 

I have attached the pbix file for this example below, hope it helps you.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
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
Anonymous
Not applicable

Hi, @RichOB 

I am glad to help you.

 

It is assumed that you have already created this Measure:

Completed_within_total = 
    CALCULATE(
        COUNT('Table'[Job_Number]),
        KEEPFILTERS('Table'[Status] = "Completed - Within target"),
        'Table'[Date_Completed] >= DATE(2018,4,1),
        'Table'[Date_Completed] <= DATE(2025,3,31)
    )

 

Please create three Measures based on the following DAX formulas and I hope they do help you:
Total_Jobs:

Total_Jobs = COUNT('Table'[Job_Number])


Indoor_Completed_Percentage:

Indoor_Completed_Percentage = 
    CALCULATE(
        [Completed_within_total],
        FILTER(
            'ContractorTable',
            'ContractorTable'[Contractor] IN {"Jones Plumber", "North Heating", "Smith Electrician"}
        )
    ) / CALCULATE(
            [Total_Jobs],
            FILTER(
                'ContractorTable',
                'ContractorTable'[Contractor] IN {"Jones Plumber", "North Heating", "Smith Electrician"}
            )
         )


Outdoor_Completed_Percentage:

Outdoor_Completed_Percentage = 
    CALCULATE(
        [Completed_within_total],
        FILTER(
            'ContractorTable',
            'ContractorTable'[Contractor] IN {"Davis Roofing", "Mark Gutters"}
        )
    ) / CALCULATE(
            [Total_Jobs],
            FILTER(
                'ContractorTable',
                'ContractorTable'[Contractor] IN {"Davis Roofing", "Mark Gutters"}
            )
         )

 

Output:

vfenlingmsft_0-1739759211313.png

 

I have attached the pbix file for this example below, hope it helps you.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Rupak_bi
Super User
Super User

Hi,

Please share the desired Output based on the sample data. The ask is not much clear to me.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Hi @Rupak_bi thanks for your reply.

I need two measures that separate the contractors to Indoor and outdoor contractors so I can make a Completed % dial like below.

dials.png

 

Thanks

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors