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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Calculation by Category

Hello All, 

I have a table 

need to add a calculated column the calculation is 

Paid Cost = sum of Planned cost + Sum of Substation/count of Circuit 

SubstationCircuit NamePlanned Cost
ArdmoreArdmore 24$14,793
ArdmoreArdmore 24$32,603
ArdmoreArdmore 24$40,000
ArdmoreArdmore 24$118,000
ArdmoreArdmore 24$383,180
ArdmoreArdmore 24$1,064,590
BellcowBellcow 21$19,279
BellcowBellcow 21$26,091
BellcowBellcow 21$35,000
BellcowBellcow 21$190,000
BellcowBellcow 21$463,180
BellcowBellcow 21$848,958
BellcowBellcow 50$12,476
BellcowBellcow 50$25,000
BellcowBellcow 50$27,383
BellcowBellcow 50$124,500
BellcowBellcow 50$298,180
BellcowBellcow 50$902,740
BellcowSubstation$1,919
BellcowSubstation$8,392
BellcowSubstation$15,000
BellcowSubstation$50,000
BellcowSubstation$84,330
BellcowSubstation$200,000

 

for Ardmore there is no Substation so the Paid Cost = sum of Planned cost which is $1,653,166

 but for Bellcow we have 2 Circuit and substation 

so the Paid Cost calculation is sum of Planned cost + Sum of Substation/count of Circuit

Note the Paid Cost calculation for Substation will be just sum of planned cost 

SubstationCircuit NamePlanned CostPaid Cost 
ArdmoreArdmore 24$14,793$1,653,166
ArdmoreArdmore 24$32,603$1,653,166
ArdmoreArdmore 24$40,000$1,653,166
ArdmoreArdmore 24$118,000$1,653,166
ArdmoreArdmore 24$383,180$1,653,166
ArdmoreArdmore 24$1,064,590$1,653,166
BellcowBellcow 21$19,2791762328.5
BellcowBellcow 21$26,0911762328.5
BellcowBellcow 21$35,0001762328.5
BellcowBellcow 21$190,0001762328.5
BellcowBellcow 21$463,1801762328.5
BellcowBellcow 21$848,9581762328.5
BellcowBellcow 50$12,4761755525.5
BellcowBellcow 50$25,0001755525.5
BellcowBellcow 50$27,3831755525.5
BellcowBellcow 50$124,5001755525.5
BellcowBellcow 50$298,1801755525.5
BellcowBellcow 50$902,7401755525.5
BellcowSubstation$1,919$359,641
BellcowSubstation$8,392$359,641
BellcowSubstation$15,000$359,641
BellcowSubstation$50,000$359,641
BellcowSubstation$84,330$359,641
BellcowSubstation$200,000$359,641

 

5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Creat a column 

Column =
IF (
    'Table'[Circuit Name] = "Substation",
    CALCULATE (
        SUM ( 'Table'[Planned Cost] ),
        FILTER (
            'Table',
            'Table'[Substation] = EARLIER ( 'Table'[Substation] )
                && 'Table'[Circuit Name] = "Substation"
        )
    )
        / CALCULATE (
            DISTINCTCOUNT ( 'Table'[Circuit Name] ),
            FILTER (
                'Table',
                'Table'[Substation] = EARLIER ( 'Table'[Substation] )
                    && 'Table'[Circuit Name] = "Substation"
            )
        ),
    CALCULATE (
        SUM ( 'Table'[Planned Cost] ),
        FILTER ( 'Table', 'Table'[Substation] = EARLIER ( 'Table'[Substation] ) )
    )
        / CALCULATE (
            DISTINCTCOUNT ( 'Table'[Circuit Name] ),
            FILTER ( 'Table', 'Table'[Substation] = EARLIER ( 'Table'[Substation] ) )
        )
)

Capture1.JPG

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

Anonymous
Not applicable

HI there 

the Calculation went somewhere wrong the paid cost value will be 

SubstationCircuit NameCircuit Number Planned Cost  Paid Cost  
BellcowBellcow 50710450 $        124,500$1,570,099.41
BellcowBellcow 50710450 $        902,740$1,570,099.41
BellcowBellcow 50710450 $          12,476$1,570,099.41
BellcowBellcow 50710450 $          27,383$1,570,099.41
BellcowBellcow 50710450 $        298,180$1,570,099.41
BellcowBellcow 50710450 $          25,000$1,570,099.41
BellcowBellcow 21710421 $        190,000$1,762,328.16
BellcowBellcow 21710421 $        848,958$1,762,328.16
BellcowBellcow 21710421 $          19,279$1,762,328.16
BellcowBellcow 21710421 $          26,091$1,762,328.16
BellcowBellcow 21710421 $        463,180$1,762,328.16
BellcowBellcow 21710421 $          35,000$1,762,328.16
BellcowSubstation  $          84,330$359,640.80
BellcowSubstation  $          15,000$359,640.80
BellcowSubstation  $          50,000$359,640.80
BellcowSubstation  $        200,000$359,640.80
BellcowSubstation  $            1,919$359,640.80
BellcowSubstation  $            8,392$359,640.80

Hi @Anonymous 

Capture11.JPG

final =
VAR t1 =
    CALCULATE (
        SUM ( 'Table 6'[Planned Cost] ),
        FILTER (
            'Table 6',
            'Table 6'[Substation] = EARLIER ( 'Table 6'[Substation] )
                && 'Table 6'[Circuit Name] = EARLIER ( 'Table 6'[Circuit Name] )
        )
    )
VAR c1 =
    CALCULATE (
        DISTINCTCOUNT ( 'Table 6'[Circuit Name] ),
        FILTER (
            'Table 6',
            'Table 6'[Substation] = EARLIER ( 'Table 6'[Substation] )
                && 'Table 6'[Circuit Name] <> "Substation"
        )
    )
VAR t2 =
    CALCULATE (
        SUM ( 'Table 6'[Planned Cost] ),
        FILTER (
            'Table 6',
            'Table 6'[Substation] = EARLIER ( 'Table 6'[Substation] )
                && 'Table 6'[Circuit Name] = "Substation"
        )
    )
RETURN
    t1 + t2 / c1

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

Ashish_Mathur
Super User
Super User

Hi,

How did you calculate the figure of 1762328.5?  Show it clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi there 

 

the calculation 

sum of Bellcow 50=  $1,390,279 (124,500+902,740+12,476+27,383+298,180 +25,000)

sum of Bellcow 21 = $1,582,508(190,000+848,958+19,279+26,091+463,180+35,000)

sum of Substation = $359,641(84,330+15,000+50,000+200,000+1,919+8,392

 

now the Paid Calculation =  sum of Bellcow 50+(sum of Substation/2)  Note the 2 is the count of Circuit for Bellcow it will be different for each Circuit

                                              sum of Bellcow 21+(sum of Substation/2)

 

Bellcow 50710450 $ 1,570,099.41
Bellcow 21710421 $1,762,328.16 
Substation $359,641

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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