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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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