cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrothschild
Responsive Resident
Responsive Resident

SUMIFs by subcategory

Here's a link to Excel data: https://www.dropbox.com/s/z9odcbbk1hnhd0i/Power%20BI%20Forum%20Sample.xlsx?dl=0

Here's a link to BI file: https://www.dropbox.com/s/rbjoqspdjdmtquq/Power%20BI%20Forum%20Sample.pbix?dl=0

 

In powerBI, I'm trying to create a measure to SUM the column [BASE] (BW in Excel) subject to the following filters:

 

GroupBY [Asset ID] (column B in Excel)

> [Count] (column BC in Excel)

< max[Count] for a given [Asset ID]   (e.g., some [Count]s associated with a given [Asset ID] are 60, some are 72, some are 120)

 

in Excel, the formula would look roughly like this: 

 

=SUMIFS([Base],[Asset ID],[@[Asset ID]],[Count],">0",[Count],"<"&[@[Project Term (mos)]])

 

but I haven't figured out a simpler expression for the MAXIFS

 

 

 

 

1 ACCEPTED SOLUTION
mrothschild
Responsive Resident
Responsive Resident

This programming seemed to do the trick:

 

CALCULATE(
    SUM('Table'[Base]),
    ALLSELECTED('Table'[Asset ID]),
Filter('Table','Table'[Count]>0),
FIlter('Table','Table'[Count]<'Table'[Project Term (mos)]+1)
)

View solution in original post

1 REPLY 1
mrothschild
Responsive Resident
Responsive Resident

This programming seemed to do the trick:

 

CALCULATE(
    SUM('Table'[Base]),
    ALLSELECTED('Table'[Asset ID]),
Filter('Table','Table'[Count]>0),
FIlter('Table','Table'[Count]<'Table'[Project Term (mos)]+1)
)

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors