Forum Discussion
Anonymous
5 years agoNot applicable
Group By with condition
I have 2 dimension tables "dim1" and "dim2", both connected to a fact table, factTab. The columns in each table are as below: (ID1 and ID2 are whole numbers used for relationship to factTab) fa...
- 5 years ago
Anonymous If you do the GROUPBY as shown, you should be able to reference [startDate], [endDate] and [TotalAmt] columns. You would not use any kind of prefix when referencing these columns.
Greg_Deckler
Community Champion
5 years agoAnonymous If you do the GROUPBY as shown, you should be able to reference [startDate], [endDate] and [TotalAmt] columns. You would not use any kind of prefix when referencing these columns.
Anonymous
5 years agoNot applicable
Greg_Deckler It worked!! Thank you 🙂
But for comparison I had to refer to those dim table columns
OverallAmount =
var calctab=GROUPBY(
factTab,
dim1[startDate],
dim2[endDate],
"TotalAmt",
SUMX(
CURRENTGROUP(),
factTab[total_amount]
)
)
return
SUMX(
FILTER(
calctab, dim1[startDate]<dim2[endDate],
[TotalAmt]
)