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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Henrik_99
Resolver I
Resolver I

Calculated sum from another table

Hi everyone,

 

I am making a report in Power BI. I am trying to get used hours per area (Id); building; group(no). I have two tables. The way my data is formatted there are two tables, one (table a) that has used hours with each representing the value of one id per project within one Yearweek.

The other (b) (main report) has the ordre, weight status, phase and general information. The tables have a relationship throught the ID column, with the one side being the Used hours and the many being the main report with ordre, weight. Table b is containing less amount of ID`s than table a.

This is what I have written so far in main report table:

 

Usedhours_measure = CALCULATE(SUM(HOURS[USED_HOURS]);FILTER(HOURS;HOURS[Group]=VALUES(Ordre[Group])))

 

It does give correct sum for group and give an error if I want to show several groups, how do you write dax to sum used order dynamically per building or per phase or per group from main report.

 

Used hours (a):

Pic2.JPG

Main report (b):

Pic1.JPG

 

 Relations:

Pic3.JPG

 

 

Show example main report:

Pic4.JPG

 

1 ACCEPTED SOLUTION

@Henrik_99,

 

You may use a similar way as shown here.

Community Support Team _ Sam Zha
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
Henrik_99
Resolver I
Resolver I

Thanks, that helps a bit further.

 

UsedHours_Buildingblock = CALCULATE(SUM(AA_RV_KPI_HOURS_6106[USED_HOURS]);FILTER(AA_RV_KPI_HOURS_6106;AA_RV_KPI_HOURS_6106[Building]=MAX(ReportResult09[Building])&&AA_RV_KPI_HOURS_6106[Discip]=MAX(ReportResult09[Discip])))

 

However, the table is not showing expected total sum as shown below. Feedback will be appriciated, thanks, rgds H

 

PBI.JPG

@Henrik_99,

 

You may use a similar way as shown here.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, v-chuncz-msft!

 

Rgds

Henrik

v-chuncz-msft
Community Support
Community Support

@Henrik_99,

 

Here you may use MAX Function instead of VALUES Function.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.