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

Dynamic Parameter

I have a parameter I am trying to create in order to determine the revenue associated with a dynamic number of customers. This formula gives me all of the revenue rather than limiting it to the number of customers selected by the parameter. How would I fix this?

Top N =
   Calculate(sum([Rev]),
       TopN(Parameter Value, VALUES([Customer Rank]), sum([Rev]), ASC)
)

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @czuniga ,

 

We can create a measure as below to work on it.

Measure = 
VAR a =
    ADDCOLUMNS (
        'Table',
        "rank", RANKX ( ALL ( 'Table' ), 'Table'[value],, DESC, DENSE )
    )
RETURN
    SUMX ( FILTER ( a, [rank] <= Parameter[Parameter Value] ), 'Table'[value] )

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
FrankAT
Community Champion
Community Champion

Hi @czuniga ,

use the what-if parameter, see figure. It creates a new table with a measure. Insert this measure in your TopN measure.

 

31-03-_2020_00-32-59.png

 

Regards FrankAT

@FrankAT  That's what I'm using. I apologize if that wasn't clear. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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