Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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