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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
nujkram
Regular Visitor

Adding records in new table based on distinct row with computation

Good day everyone, I'm new with Power BI just wanted to ask how can I add the distinct items from one table into another.

 

I wanted to save all the distinct group_items in [Items] Table to [Duration] Table and compute the total created time for each group_items. See sample image below. I've been searching all day now still no chance.

 

Untitled-1.jpg

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @nujkram

First in query editor

add two custom columns (Add Column->Custom Column)

Custom=DateTime.Time([created])

Custom.1= #time(Time.Hour([Custom]),0,0)

6.png

7.png

 

Second in Data View, create two calculated columns

duration = [Custom]-[Custom.1]

sumduration = CALCULATE(SUM(Sheet5[duration]),ALLEXCEPT(Sheet5,Sheet5[items]))

8.png

 

Second create a new table and create a calculated column in this new table

Table = SUMMARIZE(Sheet5,Sheet5[items],Sheet5[sumduration])

id = RANKX(ALL('Table'),'Table'[items],,ASC)

9.png

 

 

Best regards

maggie

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @nujkram

First in query editor

add two custom columns (Add Column->Custom Column)

Custom=DateTime.Time([created])

Custom.1= #time(Time.Hour([Custom]),0,0)

6.png

7.png

 

Second in Data View, create two calculated columns

duration = [Custom]-[Custom.1]

sumduration = CALCULATE(SUM(Sheet5[duration]),ALLEXCEPT(Sheet5,Sheet5[items]))

8.png

 

Second create a new table and create a calculated column in this new table

Table = SUMMARIZE(Sheet5,Sheet5[items],Sheet5[sumduration])

id = RANKX(ALL('Table'),'Table'[items],,ASC)

9.png

 

 

Best regards

maggie

Thank you so much @v-juanli-msft (maggie). Works like a charm!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Kudoed Authors