Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

Data filter in the same column

Best regards.

I hope they will help me with a problem I have in my data model. I've been on youtube and the network for a while and I still can't find anything.

The drawback is that I occupy a measure that shows me only the values less than zero of the same column.

I already tried with sumx and filter but it does not give me accurate data. I don't want to add calculated column in Query because I slow down the model. Another option that I was reviewing is addcolum but I did not manage to reach the result. The solution should definitely be with DAX.

columna filtrada.png

I hope you can help me.

In advance thank you very much

Atte.

Roberto Aviles

  • PaulDBrown's avatar
    PaulDBrown
    4 years ago

    Try this:

    -ve Values =
    SUMX (
        FTable,
        CALCULATE ( IF ( SUM ( 'FTable'[Value] ) < 0, SUM ( 'FTable'[Value] ), 0 ) )
    )
    

     

6 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    Can you please post sample data and a depiction of the expected output?

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      RAVILES_1-1647719378795.png

      Practically what I am looking for is to filter the negative differences and show it to me in a new column, but that the products where it is not negative continue to show me at zero. in the column of differences there are negatives and positives. I occupy a measure that allows me to know how much is only the negatives

      • PaulDBrown's avatar
        PaulDBrown
        Community Champion

        Thanks but we cannot work on an image. Please provide actual data or a sample PBIX file (without confidential data).

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi Syndicate_Admin 

    try this, 

    Best Regards,

    Community Support Team _Tang

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