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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Karlie69
Regular Visitor

Quality indicator /How to link two tables

Hello 🙂

 

I have two tables: a register of claimed products (complaint number, type, claimed qty, reason etc.) and table of all produced products (type, produced qty etc.).

 

First table (register of claimed products)

Complaint No.TypeClaimed qtyYearQuarter
20210307wardrobes720211
20210422tables3020212
20210831chairs10020213

 

Second table (all produced products)

CodeTypeProduced qtyYearQuarter
WARD001wardrobes30020211
TABL008tables75820212
CHA005chairs231020213

 

Based on first table, I created a report with statistics and charts. However I'd like to add two other indicators:

  • qty of claimed tables and chairs / qty of produced tables and chairs
  • qty of claimed wardrobes / qty of produced wardrobes

 

I created three measures:

  • Comp/Qty All types = FORMAT ( ( SUM(Register[Claimed qty]) / SUM(Overall[Produced qty]) ) , "Percent")
  • Comp/Qty Wardrobe = CALCULATE(
    Quantity[Comp/Qty All types],
    FILTER(
    CROSSJOIN(
    ALL(Overall[Code]),
    ALL(Register[Type])
    ),
    Quantity[Code] = "WARD001" &&
    Register[Type] = "Wardrobes"
    )
    )
  • Comp/Qty w/o wardrobes = CALCULATE(
    Quantity[Comp/Qty All types],
    FILTER(
    CROSSJOIN(
    ALL(Overall[Code),
    ALL(Register[Type])
    ),
    Quantity[Code] <> "WARD001" &&
    Register[Type] <> "Wardrobes"
    )
    )
There are the two filters in this report (year and quarter). Both tables are linked by the "Year" column. Unfortunately, this is exactly the problem. When I want to see the indicators for one year and all quarters - everything works great. But when I want to see the indicators for one year and one quarter - there is mistake. The indicator is calculated according to the formula: quantity of claimed products in a given quarter / quantity produced for all quarters. What can I do for the indicator to take into account the number of products produced only in a given quarter?
 
I thought about creating an index with which I would link both tables (e.g. year_quarter), but that would also be wrong. There are product complaints not in every quarter, so there would be no such data in the table.
 
Anyone have an idea to solve my problem? 🙂 I would like the indicator to be calculated correctly both for all quarters and for one quarter.
 
1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Karlie69 ,

 

I recommend that adjust your table to this

create three dimension tables

  • Product
  • Claims
  • Time

Then you can create relationships between these tables and the already existing ones, that are called fact tables.

You have to be aware that a relationship between the tables can be established on using a single column, for this reason you have to create a new column in the existing tables that are concatenating the content from the year/quarter columns.

 

Creating a data model is key for performance, analytical capability, and also data visualization. For this reason, I recommend this tutorial as a starter for data modeling with Power BI: Model data in Power BI - Learn | Microsoft Docs

 

Hopefully, this provides some new insights and will help to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey @Karlie69 ,

 

I recommend that adjust your table to this

create three dimension tables

  • Product
  • Claims
  • Time

Then you can create relationships between these tables and the already existing ones, that are called fact tables.

You have to be aware that a relationship between the tables can be established on using a single column, for this reason you have to create a new column in the existing tables that are concatenating the content from the year/quarter columns.

 

Creating a data model is key for performance, analytical capability, and also data visualization. For this reason, I recommend this tutorial as a starter for data modeling with Power BI: Model data in Power BI - Learn | Microsoft Docs

 

Hopefully, this provides some new insights and will help to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors