Skip to main content
cancel
Showing results for 
Search instead 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

Reply
clock0928
Helper I
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) - 
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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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