Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

TREATAS in Power Pivot

Hi All,

i am trying to use "TREATAS" function in a Power Pivot model (so in Excel). It seems that this function does not exist. Is this a problem related to the excel version or this function is available only in PBI? Eventually how i can achieve the same result without using this function in Power Pivot (create a virtual relationship)

thanks for the support

Best

Luca

  • selimovd's avatar
    selimovd
    5 years ago

    Hey Anonymous ,

     

    without knowing your data source I think the following measure should give you the same result:

    Ordinato2 =
    CALCULATE(
        SUM( 'Sales Orders'[ValoreOrdinato #] ),
        INTERSECT(
            ALL( 'Sales Orders'[COMMESSA_RIF] ),
            VALUES( Database[COMMESSA_RIF] )
        )
    )

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     

     

6 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey Anonymous ,

     

    the function TREATAS doesn't exist in Power Pivot for Excel:

     

    TREATAS – DAX Guide

     

    I don't know exactly your scenario, but you could probably try to solve it with FILTER or INTERSECT.

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi selimovd

      i am managing the problem with this formula in PBI 

      Ordinato2 = CALCULATE(SUM('Sales Orders'[ValoreOrdinato #]),TREATAS(VALUES(Database[COMMESSA_RIF]),'Sales Orders'[COMMESSA_RIF]))
      How i can change it to make it fit in Power Pivot?
      thanks
      Luca
      • selimovd's avatar
        selimovd
        Most Valuable Professional

        Hey Anonymous ,

         

        without knowing your data source I think the following measure should give you the same result:

        Ordinato2 =
        CALCULATE(
            SUM( 'Sales Orders'[ValoreOrdinato #] ),
            INTERSECT(
                ALL( 'Sales Orders'[COMMESSA_RIF] ),
                VALUES( Database[COMMESSA_RIF] )
            )
        )

         

        If you need any help please let me know.
        If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
         
        Best regards
        Denis