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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PowerBeeTree
Frequent Visitor

clarify how propagation works (matrix adds and unexpected empty row)

This is a question i have seen many times but the answers provided in other posts don't help me understand what is potentially wrong.

 

The purpose of the examplte below is to clarify any confussion i may have around the propagation concept therefore let's use the following example.

 

Assume I have the following sales_table:

 

      date     product  sales

03/01/2024A3
03/02/2024A5
03/03/2024A8
03/04/2024A20
03/05/2024A2
03/04/2024A0
03/05/2024A7
03/06/2024A7
03/07/2024A11
03/08/2024A12
03/09/2024A6
03/10/2024A8
03/11/2024A18
03/12/2024A2
03/13/2024A5
03/14/2024A9
03/15/2024A6
03/03/2024B70
03/07/2024B75
03/08/2024B80
03/12/2024C40
03/14/2024C48

 

I want to filter (get in a matrix format) the product level sales using another table as the filtration layer and for any unmatched values to get a BLANK value. Continuing on the example above let's suppose for illustration purposes i want to get the product level sales for a predefined set of dates (no particular rule):

 

here is the provided filtration table i am using:

cdate

03/01/2024
03/02/2024
03/03/2024
03/07/2024
03/08/2024
03/09/2024
03/14/2024
03/15/2024
03/20/2024
03/21/2024

 

And the relationship between the two tables:

PowerBeeTree_1-1710793499138.png

 

 

From what i understand the relationship should be one to many from the "custom_dates" to the "sales_table" as the unique "cdate" will propagate following the arrow direction and filter the dates in the "date" column of the sales_table. However the output adds and extra row at the top which captures any sales for those dates of the "custom_dates" table that didnt exist in the "sales_table". Also some of the dates in the "cdates" that dont exist in the "date" column dont populate with blank values for each of the products.

 

PowerBeeTree_2-1710793589399.png

 

When i change the cardinality to many:many the result is closer to the expected as the empty row is vanished although the total for product C is still including the nonmatched values (also non matching dates still not showing empty values). However I believe this should be wrong as i specified earlier that "cdates" are unique values and therefore need to always be the "one" side of the cardinality.

PowerBeeTree_3-1710794045737.png

As a result i judge from the above that i might be missing something in terms how filtration and propagation works. 

 

Can someone please help (am beginner level obviously )?

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

Hi @PowerBeeTree ,

Maybe you can try this:

First of all, create a new table to merge this two table with the dax:

 

Table =
SELECTCOLUMNS (
    FILTER (
        CROSSJOIN ( 'sales_table', 'custom_dates' ),
        'sales_table'[date] = 'custom_dates'[cdate]
    ),
    "cdate", [cdate],
    "product", [product],
    "sales", [sales]
)

 

vyilongmsft_0-1710832453912.png

Then create a matrix, the result is as follow:

vyilongmsft_1-1710832478314.png

 

 

 

Best Regards

Yilong Zhou

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-yilong-msft
Community Support
Community Support

Hi @PowerBeeTree ,

Maybe you can try this:

First of all, create a new table to merge this two table with the dax:

 

Table =
SELECTCOLUMNS (
    FILTER (
        CROSSJOIN ( 'sales_table', 'custom_dates' ),
        'sales_table'[date] = 'custom_dates'[cdate]
    ),
    "cdate", [cdate],
    "product", [product],
    "sales", [sales]
)

 

vyilongmsft_0-1710832453912.png

Then create a matrix, the result is as follow:

vyilongmsft_1-1710832478314.png

 

 

 

Best Regards

Yilong Zhou

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

Thanks, it looks like i will have to merge the two table with one of the JOIN functions DAX provides.

 

Also here is another workaround:

 

After doing some research and experimentation looks like by default Power BI will show all rows regardless the type of connection between two tables. The only way to remove any unwanted ones is to address this through the filters.  By removing the Blanks from the rows for the specific visual i get all the values i expect in the rows and the total in the bottom is correct. 

 

This is in case someone finds it helpful.

 

 

PowerBeeTree
Frequent Visitor

i figured how to show the BLANK rows for the non matching days. I had to activate the following field.

 

PowerBeeTree_0-1710800177185.png

 

 

however the main question remains, why is that extra row added at the very top? shouldn't the propagation for the 1:many cardinality provide by definition a fix for it?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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