Forum Discussion
Anonymous
3 years agoNot applicable
Extension of a previous DAX Query
Hi Guys, This is an extension of the query listed here : https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-Can-I-use-DAX-to-achieve-my-desired-goal-below-Pulling-a/m-p/3396761#M1...
- 3 years ago
I think you can use
New table = SELECTCOLUMNS( GENERATE( SELECTCOLUMNS( 'Table1', "Tower ID", 'Table1'[Tower ID], "MaxHeight", 'Table1'[Height] ), VAR MaxHeight = [MaxHeight] RETURN CALCULATETABLE( SELECTCOLUMNS( 'Table2', "height", 'Table2'[height], "SRF", 'Table2'[SRF] ), 'Table2'[height] <= MaxHeight ) ), "Tower ID", [Tower ID], "Height", [height], "SRF", [SRF] )
johnt75
Super User
3 years agoI think you can use
New table =
SELECTCOLUMNS(
GENERATE(
SELECTCOLUMNS(
'Table1',
"Tower ID", 'Table1'[Tower ID],
"MaxHeight", 'Table1'[Height]
),
VAR MaxHeight = [MaxHeight]
RETURN
CALCULATETABLE(
SELECTCOLUMNS(
'Table2',
"height", 'Table2'[height],
"SRF", 'Table2'[SRF]
),
'Table2'[height] <= MaxHeight
)
),
"Tower ID", [Tower ID],
"Height", [height],
"SRF", [SRF]
)- Anonymous3 years agoNot applicable
Hi , johnt75 thanks for the response..
I am now trying to get SRF's between levels defined by 2 variables which in turn have been defined as columns in the table... as shown below beween Midtop and Midbot But when I run this i get the error saying meomery not available and throws an error..
How can I incorporate multiple conditions in calculate tableMID_Section_SRF_BYLEVEL = SELECTCOLUMNS( GENERATE( SELECTCOLUMNS( 'Bottom_Middle', "Tower ID",Bottom_Middle[TowerModelId], "Midtop", Bottom_Middle[MIdtoplevel], "Midbot",Bottom_Middle[Bottom_Section_Height] ), VAR MaxHeight = [Midtop] VAR Midbot=[Midbot] RETURN CALCULATETABLE( SELECTCOLUMNS( 'TowerResultExtremeYielding', "height", TowerResultExtremeYielding[Level], "SRF", TowerResultExtremeYielding[Extreme_SRF], "Loadcase", TowerResultExtremeYielding[LoadCase] ), TowerResultExtremeYielding[Level] <= MaxHeight && TowerResultExtremeYielding[Level] >=Midbot ) ), "Tower ID", [Tower ID], "Height", [height], "SRF", [SRF], "Loadcase",[LoadCase] )could i get some help as how I can fix this ?