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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
YZ_Chung
Frequent Visitor

New table with parent-child hierarchy and date

I've found a couple of leads here and elsewhere by google already but haven't been able to solve the issue: I have two date tables, the first one lists the market demand quantity & need date; while the second table lists the process and time needed. The idea is to measure the time needed for a process during a month. Prior to Power BI, I was running excel Macro with for-loop to get the same result (new table), then using Pivot Table to visualize the insight. Wonder if Power BI can make this task quick and simple.

 

Example below:

Table A - Demand

DateProductQuantity (Demand)
2020/4/1A10
2020/4/1B20
2020/5/1B30

 

Table B - Process

ProductProcessTime Needed (Minutes)
ACut20
AOven20
AInspect10
BCut25
BInspect15

 

And here's the desired outcome:

DateProductProcessTotal Time*
2020/4/1ACut200
2020/4/1AOven200
2020/4/1AInspect100
2020/4/1BCut500
2020/4/1BInspect300
2020/5/1BCut750
2020/5/1BInspect450

*Total time= (Time needed of a process/product) * (Demand during a month )

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@YZ_Chung 

Try like

summarize(
filter(
crossjoin(selectcolumns(Demand,"Date",Demand[Date],"Product",Demand[Product],"Quantity (Demand)",Demand[Quantity (Demand)])
, selectcolumns(Process,"Bproduct",Process[Product],"Process",Process[Process],"Time Needed (Minutes)",process[Time Needed (Minutes)])
),[Product] = [Bproduct]),[Date],[Product],[Process], "Total Time",sum([Quantity (Demand)]*[Time Needed (Minutes)]))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-xuding-msft
Community Support
Community Support

Hi @YZ_Chung ,

You could try to implement it in Query Editor. Please follow this to have a try.

1.gif

Best Regards,
Xue Ding
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

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi @YZ_Chung ,

You could try to implement it in Query Editor. Please follow this to have a try.

1.gif

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

@v-xuding-msft  it works perfectly well. I appreciate for your help!

amitchandak
Super User
Super User

@YZ_Chung 

Try like

summarize(
filter(
crossjoin(selectcolumns(Demand,"Date",Demand[Date],"Product",Demand[Product],"Quantity (Demand)",Demand[Quantity (Demand)])
, selectcolumns(Process,"Bproduct",Process[Product],"Process",Process[Process],"Time Needed (Minutes)",process[Time Needed (Minutes)])
),[Product] = [Bproduct]),[Date],[Product],[Process], "Total Time",sum([Quantity (Demand)]*[Time Needed (Minutes)]))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak it almost works except the sum function shows "Parameter is not the correct type." I use "new column" to resolve the issue and managed to get the correct multiply though.

Thanks for your quick answer!

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.

Top Solution Authors