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

Reply
Anonymous
Not 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
 
1 REPLY 1
amitchandak
Super User
Super 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))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors