cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
clock0928
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) - 
clock0928_0-1685070740325.png

 

Appreciate any assistance and advice as always! 🙂

1 ACCEPTED SOLUTION
DOLEARY85
Super User
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.
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

1 REPLY 1
DOLEARY85
Super User
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.
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

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

Dashboard in a day with date

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!

Power BI Fabric Summit Carousel

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