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
Dean_AKI
Frequent Visitor

Calculate values meeting multiple Criteria only?

Lets say we have some monitoring data, that holds timing delay information; for simplicity it looks like this:

 

DeviceEventPrecise Delay (Hrs)Long Delay
AX001   3.02Yes
AX002   5.23Yes
AX003   1.33No
BX004   0.28

No

BX005

   0.55

No
BX006   24.56Yes
CX007   4.97Yes
CX008   1.31No
CX009   1.94No
CX010   18.31Yes
CX011   1.36No
CX012   3.08Yes
CX013   5.33Yes
DX014   1.14No
DX015   2.08Yes
DX016   6.55Yes
DX017   2.95Yes
DX018   2.16Yes
EX019   1.33No
EX020   1.44No
EX021   8.59Yes

 

I want to add a column to it that would calculate the total delay for a device, both in general (easy) and where it is tagged as a 'Long delay', i.e. over 2 hours.  I want to be able to generate a table like this:

 

DeviceTotal DelaysLong Delays ONLY
A9.580248997   8.2515956
B25.394543   24.56379014
C36.30746792   31.69916456
D14.88382688   13.7454788
E11.35456822

   8.591586806

 

All easy to do in Excel, but I'm looking at 20 million rows of data, so that won't work.  I can get a single filter to work, but not two at once.

 

How do I fix this?

 

Thanks

1 REPLY 1
johnt75
Super User
Super User

Create a couple of measures like

Total Delay = SUM( 'Table'[Precise delay])

Long delay only =
CALCULATE ( SUM ( 'Table'[Precise delay] ), 'Table'[Long delay] = "Yes" )

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

April Fabric Community Update

Fabric Community Update - April 2024

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

March 2024 PBI Gallery Image

Power BI Monthly Update - March 2024

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