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

## Calculate Sum of WFH/WFO days with total amount

Hi all,

I currently have measures to define the WFH days and WFO days where a single column is binary (WFH Yes/No).

WFH = CALCULATE(COUNTA('MASTER'[WFH (YES/NO)]), MASTER[WFH (YES/NO)] = "Yes")
WFO = CALCULATE(COUNTA('MASTER'[WFH (YES/NO)]), MASTER[WFH (YES/NO)] = "No")

In my data spreadsheet, I have multiple columns to collect work completed (Amount1, Amount2, Amount3, Amount4 & Amount5) - is there a way to write a Measure that will find the "Total sum of work completed WFH" and "Total sum of work completed WFO"?

Attached is an example of my data (all in one table) -

Appreciate any assistance and advice as always! 🙂

1 ACCEPTED SOLUTION
Super User

Hi,

if you're just wanting a measure based off the data you could use something like the below,:

WFH SUM = CALCULATE(SUM('Table'[AMOUNT 1]),'Table'[WFH (YES/NO)]="YES")+CALCULATE(SUM('Table'[AMOUNT 2]),'Table'[WFH (YES/NO)]="YES")+CALCULATE(SUM('Table'[AMOUNT 3]),'Table'[WFH (YES/NO)]="YES")+CALCULATE(SUM('Table'[AMOUNT 4]),'Table'[WFH (YES/NO)]="YES")+CALCULATE(SUM('Table'[AMOUNT 5]),'Table'[WFH (YES/NO)]="YES")

Just change yes to No for WFO.

Alternatively you could sum all the columns in power query first then just use a sum measure on the new column that with the filter on the WFH column to make it a little cleaner and easier to read.

Super User

Hi,

if you're just wanting a measure based off the data you could use something like the below,:

WFH SUM = CALCULATE(SUM('Table'[AMOUNT 1]),'Table'[WFH (YES/NO)]="YES")+CALCULATE(SUM('Table'[AMOUNT 2]),'Table'[WFH (YES/NO)]="YES")+CALCULATE(SUM('Table'[AMOUNT 3]),'Table'[WFH (YES/NO)]="YES")+CALCULATE(SUM('Table'[AMOUNT 4]),'Table'[WFH (YES/NO)]="YES")+CALCULATE(SUM('Table'[AMOUNT 5]),'Table'[WFH (YES/NO)]="YES")

Just change yes to No for WFO.

Alternatively you could sum all the columns in power query first then just use a sum measure on the new column that with the filter on the WFH column to make it a little cleaner and easier to read.

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