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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Add global variables to DAX

I am calling them global variables, because "Measures that can return tables" ... probably confuses too many issues. Say I have a custom calendar with exactly 52 weeks per year. Prior Year := FILTER(ALL(Calendar), Calendar[WeekNum] = MAX(Calendar[WeekNum] - 52)) ^^ Not valid today. If it was, I could then do... Sales - PY := CALCULATE([Total Sales], [Prior Year]) Profit - PY := CALCULATE([Total Profit], [Prior Year]) Maybe: VAR Prior Year := FILTER(ALL(Calendar), Calendar[WeekNum] = MAX(Calendar[WeekNum] - 52)) And call it a "global variable" or Table Measure or ... something?
Status: Needs Votes
Comments
scott31
New Member
Please add this functionality. We are getting crushed on performance because of duplication of effort that this would solve.
juandigregorio
New Member
Great idea, will save a tone of effort
olof_allner
New Member
Looking for exactly this!
fbcideas_migusr
New Member
Status changed to: Needs Votes
 
locka
Resolver I

I wish Bi developers would look at adding features that people want and give up with all this AI Rubbish which no one wants or uses. There are some very basic features that surely would'nt be difficult to implement but would be a game changer. This is one. Id like to use it with in matrix table with multiple measures so that when I drill through I know which measure to apply to my drill through table as I have a variable which is set in each measure and switch statement that allows me to select with filter measure i need to the data

CatoD
Helper I
Voted!