Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ekarpowicz
New Member

Creating new column filtered by string

Hello all,

 

Pretty new to PowerBI and so far I have been loving it. Could anyone help me with an expression that doesn't seem to be working?

 

Here it is:

 

PatColl = CALCULATE(sum('Deposits'[DepositAmt]), FILTER('Deposits',[PayDesc] = "Cash Payment - Thank You" || [PayDesc] =  "Check Payment - Thank You" || [PayDesc] =  "Carecredit Payment - Thank You" || [PayDesc] =  "Credit Card Payment - Thank You"))
 
I'm trying to make a new column that will be showing me a sum of payments with a particular string in their description. Currently, it doesn't output anything at all.. just blank cells. I suppose trying to do this by a "payment type ID" might be cleaner but I'm trying this for sake of time right now. What could I possibly be doing wrong? The strings I'm trying to grab are accurate..
 
Hope I didn't break any forum rules! Looking forward to learning and creating more.
 
Thanks everyone!
Eric
1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @ekarpowicz,

 

Please try this:

PatColl =
CALCULATE (
    SUM ( 'Deposits'[DepositAmt] ),
    FILTER (
        ALLSELECTED ( 'Deposits' ),
        [PayDesc] = "Cash Payment - Thank You"
            || [PayDesc] = "Check Payment - Thank You"
            || [PayDesc] = "Carecredit Payment - Thank You"
            || [PayDesc] = "Credit Card Payment - Thank You"
    )
)

For more advice, please share some dummy data and desired output as mentioned in this blog.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.