cancel
Showing results 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

Post Patron

## COUNTROWS using If OR

Hi,

How would I modify the following measure - OnTime =
CALCULATE(COUNTROWS ( FILTER ( OTIF, OTIF[ShiftInTime] = OTIF[TimeFrom]*[targetperc OT])))

to also multiply by [targetperc OT] if OTIF[ShiftInTime] <> OTIF[TimeFrom]

1 ACCEPTED SOLUTION
Super User
```OnTime =
CALCULATE(COUNTROWS ( FILTER ( OTIF, OTIF[ShiftInTime] = OTIF[TimeFrom]*[targetperc OT])) + COUNTROWS ( FILTER ( OTIF, OTIF[ShiftInTime] <> OTIF[TimeFrom]*[targetperc OT])) * [targetperc OT]   )```

Something like that?

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
4 REPLIES 4
Super User
```OnTime =
CALCULATE(COUNTROWS ( FILTER ( OTIF, OTIF[ShiftInTime] = OTIF[TimeFrom]*[targetperc OT])) + COUNTROWS ( FILTER ( OTIF, OTIF[ShiftInTime] <> OTIF[TimeFrom]*[targetperc OT])) * [targetperc OT]   )```

Something like that?

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Post Patron

Hi,

When I try to get the percentage of your measure of Total Calls ie. OnTime % = OnTime/Total Calls

the OnTime% changes to whatever value is selected in the slicer. Any idea why this is?

Post Patron

Yes, that works. Great, thank you.

Post Patron

Hi,

When I try to get the percentage of your measure of Total Calls ie. OnTime % = OnTime/Total Calls

the OnTime% changes to whatever value is selected in the slicer. Any idea why this is?