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

Dynamic grouping based on the parameter

Hello all,

 

I am trying to use dynamic grouping to display the total sales based on low, medium and high unit price.

The grouping table is like this.

grouping.jpg

I also used some dax expression to do the classification.

Dynamic price grouping = 
CALCULATE (
    [Total Sales],
    FILTER (
        'Sales Data',
        COUNTROWS (
            FILTER (
                'Groups for Pricing',
                'Sales Data'[Unit Price] >= 'Groups for Pricing'[Min Price]
                    && 'Sales Data'[Unit Price] < 'Groups for Pricing'[Max Price]
            )
        )
            = 1
    )
)

My question is that Is there a way to dynamically change the min Price or Max Price based the parameter put by the user?

For example, if the user pus 500 as min price it will give 500 for the min price.

 

Thank you

Zhongyang 

1 ACCEPTED SOLUTION
v-xjiin-msft
Solution Sage
Solution Sage

@rawmeat

 

In your scenario, you need to add parameters in the DAX expression to replace the fixed low, medium or high unit price. So that users can change the parameters dynamically. Right?

 

However, as I know for current Power BI, referencing parameters is currently supported via the Data Source dialogs, Filter Rows, Keep Rows (top/bottom, etc.), Remove Rows (top/bottom, etc.) and Replace Values. So I'm afraid it is not supported to use a parameter in measure or calculated column. 

 

If you have concern on this feature, I would suggest you to submit your idea here.

 

Thanks,
Xi Jin.

View solution in original post

2 REPLIES 2
v-xjiin-msft
Solution Sage
Solution Sage

@rawmeat

 

In your scenario, you need to add parameters in the DAX expression to replace the fixed low, medium or high unit price. So that users can change the parameters dynamically. Right?

 

However, as I know for current Power BI, referencing parameters is currently supported via the Data Source dialogs, Filter Rows, Keep Rows (top/bottom, etc.), Remove Rows (top/bottom, etc.) and Replace Values. So I'm afraid it is not supported to use a parameter in measure or calculated column. 

 

If you have concern on this feature, I would suggest you to submit your idea here.

 

Thanks,
Xi Jin.

Thank you for the information.

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.