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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

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

Eyelyn9_0-1671760123494.png  Eyelyn9_1-1671760136851.png

Eyelyn9_2-1671760176635.png

 

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.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

thank u

Ashish_Mathur
Super User
Super User

Hi,

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

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

Eyelyn9_0-1671760123494.png  Eyelyn9_1-1671760136851.png

Eyelyn9_2-1671760176635.png

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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