Forum Discussion
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
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
- BeaBF
Super User
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
- foodd
Community Champion
Hello samioberoi, and thank you for sharing a question with the Community. Please remember to adhere to the decorum of the Community Forum when asking a question.
Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150
This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.