Forum Discussion

ania_roh's avatar
ania_roh
Icon for Helper III rankHelper III
3 years ago

problem with Dax measure

Hello,

I need some help in building my measure because I can´t find a way. I would be very grateful if you could help me.

So,

I have three columns (in the same table): column of localization_destino_original, column of localization_destino and number:

And now, I need to build a measure which would have two parts ( one of the localization_destino and the other localization_destino_original) but we would use it in visualization filtred only by localization_destino_original, like that:

Now, the measure would have two parts: Let´s say X and Y.

Measure = X + Y

So the X would be the like that (and it works):

X= SUMX(

    FILTER(

        Table,

            Table[LOCALIZACION_DESTINO] <> ANALISIS_ALBARAN2[LOCALIZACION_DESTINO_ORIGINAL]),

Number))

 

How can I calculate my Y, if I want to say it all around?  

I will explain it with an example:

 

 

I would be very appreciated if you help me.

Thank you a lot.

 

10 Replies

  • ania_roh Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

    • ania_roh's avatar
      ania_roh
      Icon for Helper III rankHelper III

      Yes, Mahesh0016, thank you.
      I created powerbi sample but I don´t find a way to attach it here.
      The table would be like that : (localizacion_destino, localización_destino_original, value)

       

      111111111
      234311112
      234523453
      764234564
      345634565
      111123436
      234311117
      764276428
      111123459
      7642458210

       

      The measure  X would be like that: 

      The visualization is like that: 

      Now I need calculate Y (the next column in the visualization) and I don´t know how. 
      For this example, for ID_destino = 1111, Y should give 15: 

      Thank you a lot

       

      • Mahesh0016's avatar
        Mahesh0016
        Icon for Super User rankSuper User

        ania_roh 

        Y =
        SUMX (
            FILTER (
                localizationTable,
                localizationTable[localizacion_destino] = 1111
                    && localizationTable[localización_destino_original] = 1111
            ),
            localizationTable[value]
        )

        ****************************************************************************************

        _Y =
        SUMX (
            FILTER (
                localizationTable,
                localizationTable[localizacion_destino] = 1111
            ),
            localizationTable[value]
        )

         

         

        ania_roh  If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.