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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
sumiteshkumar
Helper I
Helper I

How to fix fact and dim table in power bi

i have a table "table A" (fact table) in power bi that i created by extracting the string values from a "column 9" from "table B" and then unpivoting, new columns in "table A" are "column key","column name", "column unit", "column designation", here "column key" is the common that connects with other tables, also "column key" has duplicates after unpivot, when i use these columns in slicer it shows me duplicate values, so i tried using dim table to normalise the duplicate, but dim table doesnot contain all values that we have in fact table

 

i have created a dimension table 'DimValues' from fact table 'table A', but it does not show all the values in it

DimValues =
ADDCOLUMNS(
DISTINCT(
SELECTCOLUMNS(
'table A',
"column key", 'table A'[column key]
)
),
"column name", CALCULATE(MAX('table A'[column name])),
"column unit", CALCULATE(MAX('table A'[column unit])),
"column designation", CALCULATE(MAX('table A'[column designation]))
)

7 REPLIES 7
Anonymous
Not applicable

Hi @sumiteshkumar ,
You want to extract multiple associated values from a column key, and MAX() is only suitable for aggregate data scenarios, and it can only return a single maximum value. If a column key is associated with multiple values, MAX() will not retain all of the items in those multiple values. In our test case, if you want to use DAX to return multiple values, it will be difficult, most of the functions will only return a single value, I recommend you to go to Power query to eliminate duplicates.

vxingshenmsft_0-1730265760568.png

vxingshenmsft_1-1730265805730.png

I hope this solves your problem, if you have any further questions you can contact me at any time, I will get back to you as soon as I receive your message!
I look forward to your reply!

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

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

 

 

@Anonymous thanks for you reply, so should i remove duplicates from "column name", "column unit", "column designation" in the fact table, or just "column key" duplicates in fact table?

Anonymous
Not applicable

Hi @sumiteshkumar ,
Thank you for your reply
For your question, whether to de-emphasize the column key or to de-emphasize all the data, it mainly depends on your data structure, whether the column key is related to other columns, the following are some examples, I hope it can help you understand:

 

vxingshenmsft_1-1730279120610.png

Remove duplicates of Column Key:

We can see that if we only de-emphasize the column key, he will only return a single value, thus losing the other values. When your column key column must be unique, you can do this step to ensure that there are no duplicate values.

 

vxingshenmsft_0-1730279093936.png

If these columns are used to describe the details of a column key (e.g., the same column key has multiple column names), consider keeping them in the dimension table. As we can see in the figure below.

vxingshenmsft_2-1730279165421.png

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

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

 

 

@Anonymous when i using this in slicer, it worked but when i use the same column in side filter pane it shows duplicates.

OktayPamuk80
Responsive Resident
Responsive Resident

Can you try to replace blanks with "" in your query and take distinct at the end? I had similar issues getting values from one column, that sometimes blanks can ruin your datamode.

 

Regards,

Oktay

 

Did I answer your question? Then please mark my post as the solution.

If I helped you, click on the Thumbs Up to give Kudos.

@OktayPamuk80 thanks for your reply, i tried doing same, didn't worked?

Did you also remove the duplicates afterwards, as Tom shen suggested?

 

One more thing, having blanks in the "key" field may be seen as duplicates. Filter out nulls and blank values in the key fields. What is your data model relationship show? If it is correct, it should show 1:m 

 

Regards,

Oktay

 

Did I answer your question? Then please mark my post as the solution.

If I helped you, click on the Thumbs Up to give Kudos.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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
Top Kudoed Authors