The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have the two attached data sets for the month of April. They have common fields in Service task and Work Orders, but these are going to have duplicates in both tables, and that is the problem I am having. I ultimately want to be able to add a slicer/filter in my dashboard to be able to show the amount of work being done by Service task for the "Reason for Repair" field. Any ideas?
https://drive.google.com/file/d/1yAdyhhglkfUPXtYypQctelhC7xtEfkow/view?usp=drive_link
https://drive.google.com/file/d/1rBjuKsqeHL_eg7uI7mnakEJiqGzEwnqb/view?usp=drive_link
Solved! Go to Solution.
Hi @ChrisAZ ,
Thanks for the detailed information and the screenshot,it really helps clarify the issue. To fully address the duplicate entries across your “Service Task” and “Work Orders” data and enable a reliable slicer for “Reason for Repair,” I recommend creating a dimension table in Power Query. Load both source tables, select the relevant fields (“Service Task” and “Reason for Repair”), remove duplicates, append the results, and remove duplicates again to ensure you have a unique list of combinations. Name this table DimServiceTask. In the model view, create single-direction relationships from DimServiceTask[Service Task] to the corresponding “Service Task” field in each fact table (e.g., your Shop Labor tables). This avoids bi-directional filtering issues. Then, define a DAX measure like:
Total Work by Service Task =
CALCULATE(
SUMX(
VALUES(DimServiceTask[Service Task]),
CALCULATE(SUM('Shop Labor - Plastics'[Labor Cost]) + SUM('Shop Labor - Accounting'[Labor Cost]))
),
CROSSFILTER('Shop Labor - Plastics'[Service Task], DimServiceTask[Service Task], BOTH),
CROSSFILTER('Shop Labor - Accounting'[Service Task], DimServiceTask[Service Task], BOTH)
)
This ensures you are aggregating work across tables without double counting. Use DimServiceTask[Reason for Repair] in your slicer, and place DimServiceTask[Service Task] with the new measure in your visual. This will let you filter the dashboard accurately by repair reason and show the correct labor values by service task. Finally, cross-check the results with your original source data using a table visual to validate accuracy.
If my response resolve your query,consider accepting it as solution.
Regards,
Pallavi.
Hi @ChrisAZ ,
Thanks for the detailed information and the screenshot,it really helps clarify the issue. To fully address the duplicate entries across your “Service Task” and “Work Orders” data and enable a reliable slicer for “Reason for Repair,” I recommend creating a dimension table in Power Query. Load both source tables, select the relevant fields (“Service Task” and “Reason for Repair”), remove duplicates, append the results, and remove duplicates again to ensure you have a unique list of combinations. Name this table DimServiceTask. In the model view, create single-direction relationships from DimServiceTask[Service Task] to the corresponding “Service Task” field in each fact table (e.g., your Shop Labor tables). This avoids bi-directional filtering issues. Then, define a DAX measure like:
Total Work by Service Task =
CALCULATE(
SUMX(
VALUES(DimServiceTask[Service Task]),
CALCULATE(SUM('Shop Labor - Plastics'[Labor Cost]) + SUM('Shop Labor - Accounting'[Labor Cost]))
),
CROSSFILTER('Shop Labor - Plastics'[Service Task], DimServiceTask[Service Task], BOTH),
CROSSFILTER('Shop Labor - Accounting'[Service Task], DimServiceTask[Service Task], BOTH)
)
This ensures you are aggregating work across tables without double counting. Use DimServiceTask[Reason for Repair] in your slicer, and place DimServiceTask[Service Task] with the new measure in your visual. This will let you filter the dashboard accurately by repair reason and show the correct labor values by service task. Finally, cross-check the results with your original source data using a table visual to validate accuracy.
If my response resolve your query,consider accepting it as solution.
Regards,
Pallavi.
https://drive.google.com/file/d/1IH5dXc52ndj-7Gs4BH_tkZ4EoOb6Q1AZ/view?usp=drive_link
So I have added this logic to the model, but the numbers don't add up and something is still not lined up correctly. I can tell this when I look at the totals as well as when I select an individual category and then compare it to what is in the data source. Here is that link again for reference for comparison.
https://drive.google.com/file/d/1yAdyhhglkfUPXtYypQctelhC7xtEfkow/view?usp=drive_link
Any way you can elaborate on that?
I have added my PBIX. I created the WorkOrder table and believe I have my relationships set up as you indicated. When I try using the slicer for the Reason for Repair, it still doesn't display the data.
https://drive.google.com/file/d/1IH5dXc52ndj-7Gs4BH_tkZ4EoOb6Q1AZ/view?usp=drive_link
So I see the model, but what would be the process for creating the separate WO table?
Read about Normalizing. Find the common filter attributes and normalize them out into dimension tables without duplicates. Then create a data model where you control both the original tables from the same dimension tables.