Forum Discussion

samioberoi's avatar
samioberoi
Icon for Helper III rankHelper III
2 years ago
Solved

Summing up a Measure based on some consitions

Hi everyone!

 

I have a measure e.g Measure1 created here which is working fine, but i now need to sum the values of this measure  to get the total sum as per some conditions.

 

e.g: -     Measure1 -    (Which is already created)

 

             New measure i try to create = calculate (sumx (Table_A, [Measure1]), Filter (Table_A, 

                                                             not(containsstring(Measure1, "£") && Filter(Table_A, not(containsstring([Measure1], "Available")
                                                             && Filter(Table_A, not(isblank([Measure1]))))

 

When i try to create the measure as above highlighted in blue, it gives me error. Simply speaking i just need to get the total sum of Measure1 excluding the blanks and without summing up the values for ID's which contain "£" and without the ID values containing the word Available. I could have used simply visual level filter on Measure1 to exclude "£" and word "Available", but i need to calculate this in the form of a measure because i then need it to subtract with another measure.

 

Thanks in advance for any help.

 

Regards

  • samioberoi 

     

    New Measure =
    CALCULATE(
    SUMX(
    FILTER(
    Table_A,
    NOT(
    CONTAINSSTRING(Table_A[Measure1], "£") ||
    CONTAINSSTRING(Table_A[Measure1], "Available") ||
    ISBLANK(Table_A[Measure1])
    )
    ),
    Table_A[Measure1]
    )
    )

     

    BBF

2 Replies