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
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
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.