Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am trying to create a slicer that works across all datasets - these datasets are ever changing so I need a seperate table which generates unique values on refresh within Power Query - whilst ignoring row relationships
EXAMPLE
Input
Unique Product ID | Manufacturing Plant | Material Type | Material Group | Country |
45600 | A08 | WS | AA | UK |
45601 | B04 | WS | AA | RO |
45602 | A02 | WS | AA | PO |
45603 | B04 | WA | BB | UK |
45604 | A06 | WS | AA | UK |
Transformation
Manufacturing Plant | Material Type | Material Group | Country |
A02 | WA | AA | PO |
A06 | WS | BB | RO |
A08 | UK | ||
B04 | |||
Any help would be appreciated, I've tried many options but can't seem to remove the row relationship
Solved! Go to Solution.
Hi @Anonymous ,
It sounds like you need to create dimension tables for each of the dimensions that you want to slice on.
You can create these dynamically in Power Query by using the following code in a new blank query:
let
Source = Table.Distinct(Table.SelectColumns(inputTable, "Manufacturing Plant"))
in
Source
Do this for each of the columns that you want to be able to slice against, apply all the tables to your data model, then relate dimensionTable[columnName] to factTable[sameColumnName] on a 1:MANY basis.
Use the dimension table column in any filters/slicers and it will correctly filter your fact table.
The principle you are looking for is STAR SCHEMA, and more info can be read here:
https://docs.microsoft.com/en-us/power-bi/guidance/star-schema
Pete
Proud to be a Datanaut!
Hi @Anonymous
It sounds like ou are trying to create several Bridging tables for your Data Model from multiple Fact Tables that share deminsions. To create a Distinct list for each dimension, you need to use the "Drill Down" tool in Power Query. If you Right-Click on a Column and choose either "Drill Down" to "Add as New Query". From the result, you can then use the "Remove Duplicates" tool.
From here the best thing to do is to understand the M Language generated.
Source = #"Original Table"[Original Column],
#"Remove Duplicates" = List.Distinct(Source)
The reason for this is you want add the other table column lists using the "List.Combine" function. Sorry no button for this.
Source = List.Combine( { #"Original Table"[Original Column] , #"Other Table"[Original Column] , "etc" , "etc" } ),
#"Remove Duplicates" = List.Distinct(Source)
This approach might lead to performance issue if the query folding becomes an issue. At this point, you may to pull the column lists into individual queries and then merge. There is concept call List.Buffer that may need to be added.
H Daryl, I am sure this works but I am too stupid to make it happen 😞
Thank you taking the time to reply - and perhaps someone smarter will benefit from it more
Hi @Anonymous ,
It sounds like you need to create dimension tables for each of the dimensions that you want to slice on.
You can create these dynamically in Power Query by using the following code in a new blank query:
let
Source = Table.Distinct(Table.SelectColumns(inputTable, "Manufacturing Plant"))
in
Source
Do this for each of the columns that you want to be able to slice against, apply all the tables to your data model, then relate dimensionTable[columnName] to factTable[sameColumnName] on a 1:MANY basis.
Use the dimension table column in any filters/slicers and it will correctly filter your fact table.
The principle you are looking for is STAR SCHEMA, and more info can be read here:
https://docs.microsoft.com/en-us/power-bi/guidance/star-schema
Pete
Proud to be a Datanaut!
Thank you so much for taking the time to reply, this has worked perfectly *chefs kiss*