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

Measure with conditions from two columns

Hey guys,

 

I'm trying to calculate a measure but currently blocked...

Below is a sample of my data:

 

StepStatus
OneAccepted
SecondRefused
ThirdWithdrew
FourthRefused
FourthRefused
FourthWithdrew
FourthRefused
FourthAccepted
ThirdAccepted
ThirdRefused
FourthRefused
OneWithdrew
OneAccepted
OneRefused
OneRefused
ThirdWithdrew
ThirdAccepted
SecondWithdrew
SecondAccepted
SecondAccepted

 

I would like to calculate the following ratio:

  • Numerator equal to the number of status "Withdrew" at step "Third"
  • Denominator would be all the status at step "Third" and "Fourth"

What would be the appropriate formula to create this measure in Power BI?


Thanks for the tip

1 REPLY 1
Anonymous
Not applicable

Hi @baptiste23 ,

Measure = CALCULATE(DIVIDE(COUNTROWS(FILTER('step-status', FIND("Withdrew", 'step-status'[Status],,0) && FIND("Third", 'step-status'[Step],,0))), COUNTROWS(FILTER('step-status', FIND("Third", 'step-status'[Step],,0) || FIND("Fourth", 'step-status'[Step],,0)))))
Does this work? FYI, 'step-status' can just be substituted for your table name. Hope this helps.

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.