Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi.
I want to make two parameters of my formula dynamic, i.e. replace the fixed values with values that the person running the report is selecting. The specific values are WKCurrencyType (=2) and WKRreportCurrency (=133).
-these two I would like to be able to select while running the report.
What solutions are there for this?
CURRENT FORMULA
ExchangeRate =
VAR _date = 'Sales'[WKInvoiceDate]
VAR _currency = 'Sales'[WKCurrency]
RETURN
CALCULATE( MAX('Exchange Rates'[ExchangeRates] ), year('Exchange Rates'[WKDate]) = year(_date), 'Exchange Rates'[WKSourceCurrency] = _currency, 'Exchange Rates'[WKCurrencyType]=2,'Exchange Rates'[WKReportCurrency]=133 )
Solved! Go to Solution.
Hi, @konradjonsson
If [WKInvoiceDate],[WKCurrency],[parameter1 value],[parameter2 value] are measure columns, try to encapsulate all conditions with filter function.
Measure:
ExchangeRate =
VAR _date = 'Sales'[WKInvoiceDate]
VAR _currency = 'Sales'[WKCurrency]
RETURN
CALCULATE (
MAX ( 'Exchange Rates'[ExchangeRates] ),
FILTER (
'Exchange Rates',
YEAR ( 'Exchange Rates'[WKDate] ) = YEAR ( _date )
&& 'Exchange Rates'[WKSourceCurrency] = _currency
&& 'Exchange Rates'[WKCurrencyType] = [parameter1 value]
&& 'Exchange Rates'[WKReportCurrency] = [parameter2 value]
)
)
Best Regards,
Community Support Team _ Eason
I created a What if-parameter, to replace the fixed currency settings (133). I got an error message saying; "A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
I do not how to address this.
Hi, @konradjonsson
If [WKInvoiceDate],[WKCurrency],[parameter1 value],[parameter2 value] are measure columns, try to encapsulate all conditions with filter function.
Measure:
ExchangeRate =
VAR _date = 'Sales'[WKInvoiceDate]
VAR _currency = 'Sales'[WKCurrency]
RETURN
CALCULATE (
MAX ( 'Exchange Rates'[ExchangeRates] ),
FILTER (
'Exchange Rates',
YEAR ( 'Exchange Rates'[WKDate] ) = YEAR ( _date )
&& 'Exchange Rates'[WKSourceCurrency] = _currency
&& 'Exchange Rates'[WKCurrencyType] = [parameter1 value]
&& 'Exchange Rates'[WKReportCurrency] = [parameter2 value]
)
)
Best Regards,
Community Support Team _ Eason
Thanks! Will try this.
Hi, you can use this “New parameter”,in Modeling
@konradjonsson, You can use what if the parameter of some other slicer value
CURRENT FORMULA
ExchangeRate =
VAR _date = 'Sales'[WKInvoiceDate]
VAR _currency = 'Sales'[WKCurrency]
RETURN
CALCULATE( MAX('Exchange Rates'[ExchangeRates] ), year('Exchange Rates'[WKDate]) = year(_date), 'Exchange Rates'[WKSourceCurrency] = _currency, 'Exchange Rates'[WKCurrencyType]=selectedvalues(whatif1[Value]) ,'Exchange Rates'[WKReportCurrency]=selectedvalues(whatif2[Value]) )
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |