Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Lohith_2404
New Member

TREATAS in DAX

I was going through DAX, there i got a function "TREATAS". This made me little confused that what this function is really about and what is the workflow, uses and how to use it. Can anyone explain "TREATAS" in DAX with an example.

I tried to understand the concept of TREATAS and expecting the explanation in detail with example.

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @Lohith_2404  - The TREATAS function in DAX is used to apply filters from one table to another unrelated table. It allows you to propagate filters across tables without an explicit relationship in the data model.

 

syntax: TREATAS(<column(s)>, <table>)

 

When to Use TREATAS?
✔ No direct relationships exist between tables.
✔ Need to apply filters dynamically from one table to another.
✔ Helps in virtual relationships when you don’t want to clutter the model with unnecessary joins.
✔ Works well in Disconnected Tables (Budgeting, Forecasting, What-If Analysis).

 

TREATAS function - DAX | Microsoft Learn

 

you can find more details from above learn document. Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @Lohith_2404 

 

Thank you very much rajendraongole1 for your prompt reply.

 

Please allow me to share a post here (reply 13/17):

 

Solved: Re: New Dax to calculate sum by changing join - Page 2 - Microsoft Fabric Community

 

And here's a simple example:

 

“Dim”

vnuocmsft_0-1739165637479.png

 

“Fact”

vnuocmsft_1-1739165651944.png

 

Note that there is no relationship between the two tables.

vnuocmsft_2-1739165773634.png

 

This code calculates the sum of the Amount column in the Fact table, but it filters the data in the Fact table based on the Color column in the Dim table.

 

TREATAS Test = 
CALCULATE(
    SUM('Fact'[Amount]),
    TREATAS(
        VALUES('Dim'[Color]),
        'Fact'[Color]
    )
)

 

Here is the result.

 

vnuocmsft_3-1739166174797.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Lohith_2404 

 

Thank you very much rajendraongole1 for your prompt reply.

 

Please allow me to share a post here (reply 13/17):

 

Solved: Re: New Dax to calculate sum by changing join - Page 2 - Microsoft Fabric Community

 

And here's a simple example:

 

“Dim”

vnuocmsft_0-1739165637479.png

 

“Fact”

vnuocmsft_1-1739165651944.png

 

Note that there is no relationship between the two tables.

vnuocmsft_2-1739165773634.png

 

This code calculates the sum of the Amount column in the Fact table, but it filters the data in the Fact table based on the Color column in the Dim table.

 

TREATAS Test = 
CALCULATE(
    SUM('Fact'[Amount]),
    TREATAS(
        VALUES('Dim'[Color]),
        'Fact'[Color]
    )
)

 

Here is the result.

 

vnuocmsft_3-1739166174797.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rajendraongole1
Super User
Super User

Hi @Lohith_2404  - The TREATAS function in DAX is used to apply filters from one table to another unrelated table. It allows you to propagate filters across tables without an explicit relationship in the data model.

 

syntax: TREATAS(<column(s)>, <table>)

 

When to Use TREATAS?
✔ No direct relationships exist between tables.
✔ Need to apply filters dynamically from one table to another.
✔ Helps in virtual relationships when you don’t want to clutter the model with unnecessary joins.
✔ Works well in Disconnected Tables (Budgeting, Forecasting, What-If Analysis).

 

TREATAS function - DAX | Microsoft Learn

 

you can find more details from above learn document. Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors