Forum Discussion
AgencyPowerBi
3 years agoHelper III
Referencing table as a variable
Hi guys, I'm stuck with this and getting opposing information online. I'm wondering can I make calculated table through use of variable? Code is like this: EVALUATE VAR Table1 = FILTER ( ...
- 3 years ago
Sorry. Typo mistake. Don't use the table reference only use the column reference as temporary tables cannot be referenced. It should work.
EVALUATE
VAR Table1 =
FILTER (
SUMMARIZE (
FILTER ( '_SOURCE CARS', '_SOURCE CARS'[Year] = 2022 ),
Brand_Prodaja[Brand_Promocija],
Datumi[ISO week],
"TRP", [Sum of All 18-54 I&G GRP]
),
[TRP] > 25
&& [Brand_Promocija] <> "Ništa"
)
VAR Result =
ADDCOLUMNS (
GROUPBY (
Table1,
[Brand_Promocija],
"Active weeks", COUNTX ( CURRENTGROUP (), [TRP] ),
"Total TRP", SUMX ( CURRENTGROUP (), [TRP] )
),
"TRP/Week", DIVIDE ( [Total TRP], [Active weeks] )
)
RETURN
Result
AgencyPowerBi
3 years agoHelper III
Ok, thank you. .I think I get it now. This was a huge help since I'm trying to do this for a while now 🙂
Much obliged!