cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper I

## Treatas Dax Measure error

Hi Experts

Cannot see my error in my treatas dax measure..

Total Demand by Countries =
CALCULATE(AVERAGEX('oil_iea_ieaprodbal (Countries)','oil_iea_ieaprodbal (Countries)'[Value]),
TREATAS(VALUES(oil_jet_jetfueldemand2[DDate]),'oil_iea_ieaprodbal (Countries)'[Date]) &&
TREATAS(VALUES(oil_jet_jetfueldemand2[Region]),'oil_iea_ieaprodbal (Countries)'[Country]))
1 ACCEPTED SOLUTION
Community Support

TREATAS() returns a table not returns the logical value ——TRUE or FALSE. Here is a example:

So , please replace the && in your expression with Comma( , )

``````Total Demand by Countries =
CALCULATE(AVERAGEX('oil_iea_ieaprodbal (Countries)','oil_iea_ieaprodbal (Countries)'[Value]),
TREATAS(VALUES(oil_jet_jetfueldemand2[DDate]),'oil_iea_ieaprodbal (Countries)'[Date]),
TREATAS(VALUES(oil_jet_jetfueldemand2[Region]),'oil_iea_ieaprodbal (Countries)'[Country]))
``````

Best Regards,

Eyelyn Qin

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

3 REPLIES 3
Helper I

thank u

Super User

Hi,

Share some data, describe the question and show the expected result.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Community Support

TREATAS() returns a table not returns the logical value ——TRUE or FALSE. Here is a example:

So , please replace the && in your expression with Comma( , )

``````Total Demand by Countries =
CALCULATE(AVERAGEX('oil_iea_ieaprodbal (Countries)','oil_iea_ieaprodbal (Countries)'[Value]),
TREATAS(VALUES(oil_jet_jetfueldemand2[DDate]),'oil_iea_ieaprodbal (Countries)'[Date]),
TREATAS(VALUES(oil_jet_jetfueldemand2[Region]),'oil_iea_ieaprodbal (Countries)'[Country]))
``````

Best Regards,

Eyelyn Qin

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

Announcements

#### Power BI Monthly Update - November 2023

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

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors