cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Frequent Visitor

## Summing Column on Multiple Category

Hello All,

I have this table

I already have a Tabular Model created to be used in Power BI. I was wondering how to calculated the adjusted consumption using DAX based on its formula shown below the table?

Thanks,

1 ACCEPTED SOLUTION
Super User

Hi @baw556

Do you want it across all asset types and classes? If so, place tis measure in a card visual:

```Measure =
VAR Constant_ = 4.3456
RETURN
CALCULATE ( SUM ( Table1[Consumption] ), Table1[Fuel] = "Electricity" )
+ CALCULATE ( SUM ( Table1[Consumption] ), Table1[Fuel] = "Gas" ) * Constant_
```

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers

3 REPLIES 3
Super User

Hi @baw556

Do you want it across all asset types and classes? If so, place tis measure in a card visual:

```Measure =
VAR Constant_ = 4.3456
RETURN
CALCULATE ( SUM ( Table1[Consumption] ), Table1[Fuel] = "Electricity" )
+ CALCULATE ( SUM ( Table1[Consumption] ), Table1[Fuel] = "Gas" ) * Constant_
```

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers

Frequent Visitor

Yes, I wanted to aggregate accross asset type and class.

When I appplied the formula, it only aggregates the valus for Electricity and doesn't include the secod part of the formula (Gas cons. * constant)

Any thoughts?

Thanks,

Baw556

Frequent Visitor

The desired result from below should be Adjusted_consumption approx. 203. However, using the formula above, I'm still getting 55.

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors