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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AllanBerces
Post Prodigy
Post Prodigy

Display Sum per Row

Hi Good day,

Can anyoune pls need help on my calculated column, i want to display the sum of remaining per row, pls refer below.  my cuurent calculated column. The remainig value are coming from Tb1, the calculated column is in Tb2.

 

Sum of Remaining = SUM(BRUNEI_WTI_PROGRESS_YRLY_sql[Remaining hours])

 

REMAINING_HRS =
    CALCULATE(
            [Sum of Remaining],
                    FILTER(
                        ALL(BRUNEI_WTI_PROGRESS_YRLY_sql[Sub-Task Phase]),
                        BRUNEI_WTI_PROGRESS_YRLY_sql[Sub-Task Phase] IN { "SN-10 Punchlist", "SN-11 Punchlist", "CBD-06", "PRE CPRA_WJ43", "CP-276", "CBD-09", "FL-06", "FL-09", "SN-05 Punchlist", "SN-08 Punchlist", "PRE CPRA_DP31", "SN-03 Punchlist", "SN-07 Punchlist", "2nd PRE CPRA", "02 CW-AY PRE DRILL FL"}),
                       
                    FILTER(
                        ALL(BRUNEI_WTI_PROGRESS_YRLY_sql[Main Cat.]),
                         BRUNEI_WTI_PROGRESS_YRLY_sql[Main Cat.]= "Q"))
AllanBerces_0-1712396663385.png

What i want is:

AllanBerces_1-1712396693672.png

 

my table

AllanBerces_3-1712396807830.png

Thank you


 

4 REPLIES 4
AnalyticsWizard
Solution Supplier
Solution Supplier

@AllanBerces 

To display the sum of remaining hours per row in Power BI, you can use the following DAX formula for your calculated column in Tb2:

REMAINING_HRS = 
CALCULATE(
    SUM(Tb1[Remaining hours]),
    FILTER(
        ALL(Tb1),
        Tb1[Sub-Task Phase] IN { "SN-10 Punchlist", "SN-11 Punchlist", "CBD-06", "PRE CPRA_WJ43", "CP-276", "CBD-09", "FL-06", "FL-09", "SN-05 Punchlist", "SN-08 Punchlist", "PRE CPRA_DP31", "SN-03 Punchlist", "SN-07 Punchlist", "2nd PRE CPRA", "02 CW-AY PRE DRILL FL"}
        && Tb1[Main Cat.] = "Q"
    ),
    Tb1[Date] = EARLIER(Tb2[Date])
)

This formula sums the Remaining hours from Tb1 for each corresponding Date in Tb2. It filters Tb1 to include only the rows where Sub-Task Phase matches any of the specified values and Main Cat. is “Q”. The EARLIER function is used to refer to the Date column of the current row in Tb2 within the CALCULATE function.

Please ensure that there is a relationship between Tb1 and Tb2 based on the Date column for this formula to work correctly. If there are any further details or specific requirements, feel free to provide them for more tailored assistance.

Hi, @AnalyticsWizard 

Thank you for the reply, but when I try the formula you provided it sum the overall remaining of all sub task phase and display the value on specific date. pls refer below for the output.

 

AllanBerces_0-1712480803790.png

 

Thank you

DataNinja777
Super User
Super User

Hi @AllanBerces 

You can write the calculated column like below to achieve your required output:

DataNinja777_0-1712413497447.png

I attach the pbix file below:

Hi @DataNinja777 

Thank you for your reply, but the caculated column you created is in Tb1. I want it in Tb2 hence the EARLIER function can access the ( BRUNEI_WTI_PROGRESS_YRLY_sql[Sub-Task Phase] ). Any other way to have the output i desire.

 

Thank you

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors