Forum Discussion
Anonymous
5 years agoNot applicable
Dax Direct Query Treat as
Hello everyone.
I faced the problem while using TREAT AS.
I use Storage Mode as Mixed (some of the data is direct query other dimension tables loaded as import mode)
I need to divide the monthly budget over days of months.
I have used below dax formula:
Budget Sales =
CALCULATE(
CALCULATE(SUM(FactBudget[Budget]),
TREATAS(
VALUES(FactBudget[Year_Month]),DimDate[MonthnYear])),
CROSSFILTER(FactBudget[TransDate],DimDate[Date],None))
Does TREATAS work with Direct Query (Live Connection)
Thanks in advance
dax
dax
1 Reply
- amitchandakSuper User
Anonymous ,
This is what the document says
This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
Can you share sample data and sample output in table format?
try like
Budget Sales =CALCULATE(CALCULATE(SUM(FactBudget[Budget]),filter(FactBudget,FactBudget[Year_Month] in values( DimDate[MonthnYear])),CROSSFILTER(FactBudget[TransDate],DimDate[Date],None))