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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
bipinbhaskarwar
Frequent Visitor

Create and Expand the column with all records.

Hi,

As a newbie to Power BI, requesting help.

 

I am having a dataset like below,

 

IDLOCATIONPACKAGE
1234ABCBASE
4567DEFGOLD
7900GHISILVER 
11233JKLPLATINUM 
14566MNOPLATINUM 
17899PQRGOLD
21232STUSILVER 

The list goes up to a million rows, but every package has different numbers of products in them. Like below.

 

PKGPRODSMANUFACTURER PKGPRODSMANUFACTURER PKGPRODSMANUFACTURER PKGPRODSMANUFACTURER
BASE11XYZ SILVER 11XYZ GOLD 11XYZ PLATINUM 11XYZ
BASE12XYZ SILVER 12XYZ GOLD 12XYZ PLATINUM 12XYZ
BASE13XYZ SILVER 13XYZ GOLD 13XYZ PLATINUM 13XYZ
BASE14XYZ SILVER 14XYZ GOLD 14XYZ PLATINUM 14XYZ
BASE15GHY SILVER 15GHY GOLD 15GHY PLATINUM 15GHY
BASE16GHY SILVER 16GHY GOLD 16GHY PLATINUM 16GHY
BASE17GHY SILVER 17GHY GOLD 17GHY PLATINUM 17GHY
BASE18QWE SILVER 18QWE GOLD 18QWE PLATINUM 18QWE
BASE19QWE SILVER 19QWE GOLD 19QWE PLATINUM 19QWE
    SILVER 29XYZ GOLD 29XYZ PLATINUM 29XYZ
    SILVER 30XYZ GOLD 30XYZ PLATINUM 30XYZ
    SILVER 31XYZ GOLD 31XYZ PLATINUM 31XYZ
    SILVER 32QWE GOLD 32QWE PLATINUM 32QWE
    SILVER 33GHY GOLD 33GHY PLATINUM 33GHY
        GOLD 64KLJ PLATINUM 64KLJ
        GOLD 65XYZ PLATINUM 65XYZ
        GOLD 66XYZ PLATINUM 66XYZ
        GOLD 67QWE PLATINUM 67QWE
        GOLD 68KLJ PLATINUM 68KLJ
        GOLD 69KLJ PLATINUM 69KLJ
            PLATINUM 100XYZ
            PLATINUM 101QWE
            PLATINUM 102GHY
            PLATINUM 103KLJ
            PLATINUM 104XYZ

I am unable to create the relationship between two tables because PBI says it must have some unique values.

 

I need the count of every product and count of every package through which this product is being delivered. 

 

How to do it?

I was thinking about generating a custom column where all the products shall be 'tabled' along with other details and then expanding it but don't know how to do it.

Will it do the trick? 

Please help me with it.

 

 

 

2 REPLIES 2
v-caliao-msft
Microsoft Employee
Microsoft Employee

@bipinbhaskarwar,

 

I am unable to create the relationship between two tables because PBI says it must have some unique values.

Currently Power BI not support many to many relationship directly. So when creating relationships, make sure that at least in one of the tables the value in your table are unique. 

 

Besides, you need to re-shape you table so that you can count the measure you want.

Capture.JPG

Sample Measure:

Measure = CALCULATE(COUNTA(Table1[PKG]),FILTER(Table1,Table1[PKG]="BASE"))

 

Regards,

Chalrie Liao

Thanks for the suggestion.

Actually, i get the data of package-product table exactly as you have reshaped. 

The problem is getting the counts of products and counts of product through the certain package.

I am not sure how to get it.

 

Thanks though.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.