cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## 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.