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
RogerSteinberg
Post Patron
Post Patron

How to use a what if parameter in my measure to filter top 20 products

Hi,

 

I have a table thats showing top 20 products based on a calculated column flag that i have. I put that column in my visual level filter  to only show everything under 21.

 

Instead of using that visual level filter, I'd like to have a dynamic filter (what-if parameter) . For that i need to use that column from the what if parameter table within my measure to have it dynamic.

 

How can I do this using my current measure logic:

 

Currently my column is: 

test =
IF(
MIN('Table'[current_rank])<MIN('Table'[previous_rank]),
MIN('Table'[previous_rank])-MIN('Table'[current_rank]),
(MIN('Table'[current_rank])-MIN('Table'[previous_rank]))*-1
)



2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@RogerSteinberg - What-If parameters use a measure and measures cannot impact a calculated column because columns are calculated at the time of data load/refresh.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

amitchandak
Super User
Super User

3 REPLIES 3
amitchandak
Super User
Super User

@RogerSteinberg , whatif will not work dynamically for calculated columns

Refer this for measure

https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

@RogerSteinberg - What-If parameters use a measure and measures cannot impact a calculated column because columns are calculated at the time of data load/refresh.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi,
I know.

I mentioned to "use in my measure".

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