Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
BuistJF
Helper I
Helper I

Filter a dax measure by a text value

I have a measure that I'm already using that provide me with the expected results, see DAX below:
Measure 1 = sum(Conversion[Converted]) / sum(Conversion[Count])
 
I want to re-created the same measure as above but for it to only include records where the column 'fruit' = apples, ie.
Measure 2 = (sum(Conversion[Converted]) / sum(Conversion[Count])) where fruit = "apples"
The column 'fruit' sits in the same table and every row has an allocaited fruit.
 
I need the filter to apply in the dax measure as I'll want the 2 measures sitting in a line chart. 
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@BuistJF Try:

Measure = 
  DIVIDE(
    SUMX(FILTER('Conversion',[fruit] = "apples"),[Converted]),
    SUMX(FILTER('Conversion',[fruit] = "apples"),[Count])
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Analystmate
Helper II
Helper II

@BuistJF Measure 2 = CALCULATE(sum(Conversion[Converted]) / sum(Conversion[Count]),Conversion[Fruit ]="apples")

mariussve1
Super User
Super User

hi,

 

Please try:


Var Converted = sum(Conversion[Converted])

Var Fruit = Calculate ( sum(Conversion[Count]), table[column] = "fruit" )

Var Resultat = Divide(Converted, Fruit, 0)

Return

Result

 

Br

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no
Greg_Deckler
Community Champion
Community Champion

@BuistJF Try:

Measure = 
  DIVIDE(
    SUMX(FILTER('Conversion',[fruit] = "apples"),[Converted]),
    SUMX(FILTER('Conversion',[fruit] = "apples"),[Count])
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors