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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
eunji888888
Frequent Visitor

Calculated measure for filtering specific name without making many measures

I have below measure and everything look good, but i need to do the filter in the visual part for specific channel description to have the correct number. How could i fix it? i know i can filter specific channel but i have 6 specific channel which need to make 6 measures:

 

StdPrice814(TD) =
VAR EANValue = SELECTEDVALUE(' CustGroup4 Material'[EAN])
VAR ChannelValue = SELECTEDVALUE('CustGroup4 Material'[channel description])
VAR TradeDiscountPrice =
CALCULATE(
MAXX(
FILTER(
'CustGroup4 Material',
RIGHT('CustGroup4 Material'[Description], 1) = "%" &&
' CustGroup4 Material'[channel description] = ChannelValue&&
'CustGroup4 Material'[EAN] = EANValue
),
-'CustGroup4 Material'[StdPrice]
),
'CustGroup4 Material'[Promotion yes/no] = "Trade discount"
)

RETURN IF(ISBLANK(TradeDiscountPrice), BLANK(), TradeDiscountPrice)

 

5 REPLIES 5
v-sdhruv
Community Support
Community Support

Hi @eunji888888 ,
I wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @eunji888888 ,
I wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @eunji888888 ,
I wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

pankajnamekar25
Super User
Super User

Hello @eunji888888 

If you want to dynamically filter by channel without modifying the measure each time, you can add a slicer on channel description in your report. Then, use dax

StdPrice814(TD) =

VAR EANValue = SELECTEDVALUE('CustGroup4 Material'[EAN])

 

VAR TradeDiscountPrice =

CALCULATE(

    MAXX(

        FILTER(

            'CustGroup4 Material',

            RIGHT('CustGroup4 Material'[Description], 1) = "%" &&

            'CustGroup4 Material'[EAN] = EANValue

        ),

        -'CustGroup4 Material'[StdPrice]

    ),

    'CustGroup4 Material'[Promotion yes/no] = "Trade discount"

)

 

RETURN IF(ISBLANK(TradeDiscountPrice), BLANK(), TradeDiscountPrice)

Thanks,
Pankaj

If this solution helps, please accept it and give a kudos, it would be greatly appreciated.

Hi @eunji888888 ,
Thanks for reaching out of Microsoft Fabric Community Forum.
@pankajnamekar25  Thanks for your Prompt response. In addition to the above DAX query add the below query after the "Trade discount"

'CustGroup4 Material'[channel description] = ChannelValue  -- Add this filter dynamically

You can also use the "Filters" pane to filter the visual by channel descriptions, and the measure will return the correct result based on the selected channel.

This way you only need one measure and the filtering will be dynamic according to the visual's context, saving you from creating multiple measures for each channel.

Hope this helps!

Regards,
v-aatheeque

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

 




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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