The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Does anyone know how to pass on a parameter to a SSAS query?
My current query is following
AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/XYZ", "Budget", [Query="EVALUATE
VAR _1 = 2021
VAR _01 = 4
VAR _2 =
FILTER (
dx,
dx[DataYear] = _1
&& dx[DataCAT] = "Forecast"
)
............
........
", Implementation="2.0"])
I want to pass on a parameterized value to VAR _01 like following
let
var1=4,
Source = AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/XYZ", "Budget", [Query="EVALUATE
VAR _1 = 2021
VAR _01 = var1
VAR _2 =
FILTER (
dx,
dx[DataYear] = _1
&& dx[DataCAT] = "Forecast"
)
............
........
", Implementation="2.0"])
in
Source
Is it possible?
so far I have tried
let
var1=4,
Source = AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/XYZ", "Budget", [Query="EVALUATE
VAR _1 = 2021
VAR _01 = """&var1&"""
VAR _2 =
FILTER (
dx,
dx[DataYear] = _1
&& dx[DataCAT] = "Forecast"
)
............
........
", Implementation="2.0"])
in
Source
but it did not work.
Thank you in advance.
Solved! Go to Solution.
Found it
var1=4,
var2=Text.From(var1)
VAR _01 = CONVERT("""&var2&""",INTEGER)
Found it
var1=4,
var2=Text.From(var1)
VAR _01 = CONVERT("""&var2&""",INTEGER)
great, just what I needed!
Thank you for share the finding😉.
Paul Zheng _ Community Support Team
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
80 | |
78 | |
44 | |
37 |
User | Count |
---|---|
157 | |
112 | |
64 | |
60 | |
54 |