cancel
Showing results for 
Search instead for 
Did you mean: 
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.

View solution in original post

Thank you for the information.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.