Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hello, you can use a variable within a query, for example I have this data that I must change every week within many queries, so I want to change it only in one place and it is updated dynamically in the rest of the queries.
Here's the piece of data I want to pass to a variable or save it within the registry in a table:
Weeks = 44,45,46,47,48,49,50,51,52 ----------> Every week I add another one and as it is in many queries I want to change it only in one place and update it dynamically.
This is one of many queries that I want to use a
NO VARIABLE
******************************************
******************************************
Solved! Go to Solution.
Hi @Syndicate_Admin ,
Based on your description,
You might consider creating a Calculated table.
Here is an example:
My Sample:
WeeksTable = DATATABLE(
"WeekNum", INTEGER,
{{44}, {45}, {46}, {47}, {48}, {49}, {50}, {51},{52}}
)
Use the created Calculated table in the following code, Result is as below.
Measure = CALCULATE(SUM('Table'[Sales]),
FILTER('Table','Table'[Week] IN VALUES(WeeksTable[WeekNum]))
)
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syndicate_Admin ,
Based on your description,
You might consider creating a Calculated table.
Here is an example:
My Sample:
WeeksTable = DATATABLE(
"WeekNum", INTEGER,
{{44}, {45}, {46}, {47}, {48}, {49}, {50}, {51},{52}}
)
Use the created Calculated table in the following code, Result is as below.
Measure = CALCULATE(SUM('Table'[Sales]),
FILTER('Table','Table'[Week] IN VALUES(WeeksTable[WeekNum]))
)
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 44 | |
| 19 | |
| 19 |
| User | Count |
|---|---|
| 71 | |
| 70 | |
| 34 | |
| 33 | |
| 31 |