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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
square_analytic
Frequent Visitor

Can use variables in What-if parameters, or in other slicer?

Hi, 

 

I want to create a what-if parameters based on a value from a table using variables.

why I want to use it, because I have a date filter on specific time duration, which will have a different measure values, so I want to use the max and min of the value to set limits based on the values from this duration, so we can compare individual performance in this specific period.

instead of creating a static list in what if parameters using

GENERATESERIES(static minimum number, static maximum number, interval)
I want to use 
GENERATESERIES(variable minimum number, variable maximum number, interval)
here below my code to generate the variable list.
 
RTG_KPI WIF =
var _min_dur = CALCULATE(MIN(ME5A_BASIC[Duration PR_GRN]),
USERELATIONSHIP ( DateTable[Date], ME5A_BASIC[Requisition Date] ),
FILTER (
ALLSELECTED ( DateTable[Date] ),
DateTable[Date] <= MAX ( DateTable[Date] )
)
)
var _max_dur = CALCULATE(max(ME5A_BASIC[Duration PR_GRN]),
USERELATIONSHIP ( DateTable[Date], ME5A_BASIC[Requisition Date] ),
FILTER (
ALLSELECTED ( DateTable[Date] ),
DateTable[Date] <= MAX ( DateTable[Date] )
)
)
return
GENERATESERIES(_min_dur,_max_dur,1)
 
Thanks in advance, 
 
Regards,
Mohamed. 
1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @square_analytic ,

 

Currently, Power BI doesn't support to use Measures in What-if Parameters or Slicers.

It is suggested to post your idea on Power BI Ideas

It is a place for customers to provide feedback about Power BI.
What's more, if a feedback is highly voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

In addition, Measures could be used in "Filters on this visual". Please check if this could meet your requirements.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @square_analytic ,

 

Currently, Power BI doesn't support to use Measures in What-if Parameters or Slicers.

It is suggested to post your idea on Power BI Ideas

It is a place for customers to provide feedback about Power BI.
What's more, if a feedback is highly voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

In addition, Measures could be used in "Filters on this visual". Please check if this could meet your requirements.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Icey , 

 

Thank you for your reply, I will check the ideas website for the same.

 

Regards, 

Mohamed. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.