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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Comparing Datasets

Hi,

 

I have a dataset similar to the below.

 

Dataset 1 - Invoice details

Task IDWork TypeCost
1Erect10
2Dismantle30
3Erect80

 

Dataset 2 - Product Table

Job IDTask ID
341
642
273

 

Relationships created

Dataset 1 - Dataset 2 (Task ID)

 

I want to have a two table visuals that highlights Job ID's that meet the below criterias:

 

1. Jobs that have had an erect invoice but not a dismantle

2. Jobs that have had a dismantle invoice but not an erect

 

Can anyone help me?

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

Please enable this preview. (The preview feature will take effect after restarting the desktop)

vcgaomsft_1-1654490645178.png

Connect to two datasets and create a relationship.

vcgaomsft_2-1654492993245.png

Then create a measure.

Measure = 
VAR _num_of_not_dismantle = 
CALCULATE(
    COUNTROWS
    (RELATEDTABLE('Invoice details')),
    'Invoice details'[Work Type]<>"Dismantle"
)
VAR _num_of_not_erect = 
CALCULATE
(COUNTROWS(
    RELATEDTABLE('Invoice details'))
    ,'Invoice details'[Work Type]<>"Erect"
)
RETURN
SWITCH(
    TRUE(),
    _num_of_not_dismantle=1,"Green",
    _num_of_not_erect=1,"Yellow")

Set the conditional format for the [Job id] field.

vcgaomsft_3-1654493135571.png

vcgaomsft_4-1654493169801.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Anonymous
Not applicable

Hi, 

 

Thank you for your response. I have added these steps into my report and are experiencing some issues.

 

Yellow is working as intended and showing only 'Task ID's' and 'Job ID's' with "Dismantle" records only in the 'Invoice Details' table.

 

How ever, green seems to be showing 'Task ID's' and 'Job ID's' with "Erect" & "Dismantle" records instead of the inteded "Erect" records only.

 

Any ideas as to why this might be happening?

Anonymous
Not applicable

Hi @Anonymous ,

 

Can you provide a file with no private data to cover this question? Thanks in advance.

 

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,
Gao

Community Support Team

Anonymous
Not applicable

I have pulled over the 'Work Type' column from dataset 1 (Invoice details) . This breaks creates duplicate rows where there is a task ID that has an "Erect" & "Dismantle" work type.

Serdet_1-1654513405340.png

 

Looking at the above image you can see the logic works for dismantle only worktype (yellow). But erect logic is showing some ID's that have had only erect but also ID's with erect & dismantle.

 

For example, ID 07457 has had an erect and dismantle work type but is still showing as green.

 

Would it be possible to create a third variable that highlights ID's pink if there is an erect and dismantle worktype?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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