cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper I

## SUM LOOKUPVALUE - Attempting to sum units with multiple criteria

Hi Power BI forum,

I have a vast table of transaction data and I'm hoping to find the total utilised time per staff per month in a table that looks similar to the one below. I'm struggling to find the right formula to use in my calculated column. Appreciate any suggestions.

 StaffName UnitsLogged IsUtilised MonthRecorded CalculatedColumn Sally 5 True 202010 5 Sally 2 False 202010 5 Bob 6 True 202010 9 Bob 3 True 202010 9 Bob 7 False 202010 9 Sally 4 True 202009 11 Sally 7 True 202009 11 Sally 7 False 202009 11 Bob 5 False 202009 8 Bob 8 True 202009 8

Thanks!

1 ACCEPTED SOLUTION
Super User

@PowerMyBI , Try a new column like

CalculatedColumn = sumx(filter(Table, [StaffName] =earlier([StaffName]) && [MonthRecorded] =earlier([MonthRecorded]) && [IsUtilised] ="True"),[UnitsLogged])

if IsUtilised is a boolean

CalculatedColumn = sumx(filter(Table, [StaffName] =earlier([StaffName]) && [MonthRecorded] =earlier([MonthRecorded]) && [IsUtilised] ),[UnitsLogged])

2 REPLIES 2
Super User

@PowerMyBI , Try a new column like

CalculatedColumn = sumx(filter(Table, [StaffName] =earlier([StaffName]) && [MonthRecorded] =earlier([MonthRecorded]) && [IsUtilised] ="True"),[UnitsLogged])

if IsUtilised is a boolean

CalculatedColumn = sumx(filter(Table, [StaffName] =earlier([StaffName]) && [MonthRecorded] =earlier([MonthRecorded]) && [IsUtilised] ),[UnitsLogged])

Helper I

@amitchandak that works perfectly! Thank you for help

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors