Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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]))
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    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.

  • Hi,

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    thank u