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
Ibadkhan
Helper III
Helper III

Filter a measure by measure

Hello everyone!

 

Hope you all are fine.

 

I want some help related to measure filtering. I have Measue A in which there is calculated quantity  and Measure B in which there is calculated amount. I want filter amount .i.e. Measure B by quantity in Measure A having values greater than 1, in simple words: 

Sum Measure B , Filter Measure A > 1 .

 

Thanks.

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Ibadkhan ,

Based on your description, I have created this sample table:

tb.png

MeasureA:

MeasureA =
CALCULATE (
    COUNT ( 'Table'[Class] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Class] IN DISTINCT ( 'Table'[Class] ) )
)

MeasureB:

MeasureB =
CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( 'Table', [MeasureA] > 1 ) )

 m.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yingjl
Community Support
Community Support

Hi @Ibadkhan ,

Based on your description, I have created this sample table:

tb.png

MeasureA:

MeasureA =
CALCULATE (
    COUNT ( 'Table'[Class] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Class] IN DISTINCT ( 'Table'[Class] ) )
)

MeasureB:

MeasureB =
CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( 'Table', [MeasureA] > 1 ) )

 m.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Ibadkhan , Can you share sample data and sample output in table format?  Then I can tell. Usually depening on need we use a context.

amitchandak
Super User
Super User

@Ibadkhan , You need some context / gorup by for that

//Where should mesure gorup to filter

SumX(filter(values(Table[Column]) , [Measure A] > 1  ) ,[Measure B] )

Assumed data should group at Table[Column] and then filter measureA. In case you need at the row level, use  some unique row id

@amitchandak  which colum should I use?

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.