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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Foguete
Helper I
Helper I

Add a column to a table and summarize into it based on 2 filters

Hello,

 

As I am new to Power BI, I am facing an issue.

 

I have the below table:

Foguete_1-1667400713303.png

 

I would need for everyday, to know the total of "Pallets_Stock" of grouped "AUX".

 

For example.

Let's say AUX "187N", "170N", and "030N" are part of a family I want to create called "Family 1"; I would need the return below:

 

Foguete_2-1667401035331.png

 

I need to say that an AUX can also we used in another family.

 

Anyone could help me but also explain to me the way ?

 

Kind regards

 

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@Foguete Well, probably best to create an Enter Data query like below. You could create a relationship between the tables based on the AUX columns. It will be many-to-many but that shouldn't cause an issue in most circumstances.

Family AUX
Family 1 187N
Family 1 170N
Family 1 030N
Family 2 777N
Family 2 666N
Family 2 555N
Family 3 187N
Family 3 555N
Family 3 457N


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Hi again,

 

I think I have found the solution or at least it's working

 

Instead of SUMMARIZE, as I was using different columns I used SUMMARIZECOLUMNS which gave this result in DAX:

 

Tabla_Stock_Informe =
SUMMARIZECOLUMNS(
    QueryKeynes[JDFEC],
    'Filtros Tiendas'[Tienda],
    "TOTAL PALLETS_STOCK", SUM(QueryKeynes[PALLETS_STOCK])
)
 
Thank you for the help !

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Foguete Well, probably best to create an Enter Data query like below. You could create a relationship between the tables based on the AUX columns. It will be many-to-many but that shouldn't cause an issue in most circumstances.

Family AUX
Family 1 187N
Family 1 170N
Family 1 030N
Family 2 777N
Family 2 666N
Family 2 555N
Family 3 187N
Family 3 555N
Family 3 457N


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler, thanks for the answer !

 

I have been creating the data entry and edit the relationship as the screenshot below:

Foguete_0-1667464327338.png

 

Now I am facing a new issue, at the moment of creating a new table to get something similar to the screenshot below:

Foguete_1-1667464411894.png

 

My DAX is telling me that it does not found the "Family" column (I changed the name family for "Tiendas"):

Foguete_2-1667464476658.png

 

Any idea about what did I do wrong ?

 

 

Hi again,

 

I think I have found the solution or at least it's working

 

Instead of SUMMARIZE, as I was using different columns I used SUMMARIZECOLUMNS which gave this result in DAX:

 

Tabla_Stock_Informe =
SUMMARIZECOLUMNS(
    QueryKeynes[JDFEC],
    'Filtros Tiendas'[Tienda],
    "TOTAL PALLETS_STOCK", SUM(QueryKeynes[PALLETS_STOCK])
)
 
Thank you for the help !

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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