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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
OngS2
Regular Visitor

How to sum the values in Column C, if Column A contains specific text in Column B

A

Item Name

Prod. ID
TW10-F, U=20"0001
A=4000, TC400002
TC40, 2"150#0003
TR95, FPW 1/2NPT0004
114CM, TW100005
"X"=1000, TR950006

 

Prod. ID

C

Calc Qty

00011
00021
00031
00041
00052
00061

 

B

Model

TW10
TC40
TR95

 

Hi all. is it possible for me to create a measure/column to sum up the C if A contains B? And, three of the info are in different tables.

 

Thanks for helping.

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @OngS2,

You can try to use the following measure formula to summary records across different table fields based on conditions:

fomrula =
VAR _list =
    CALCULATETABLE (
        VALUES ( A[Prod. ID] ),
        FILTER (
            ALLSELECTED ( A ),
            COUNTROWS (
                FILTER ( ALLSELECTED ( B ), SEARCH ( [Model], [Item Name], 1, -1 ) > 0 )
            ) > 0
        )
    )
RETURN
    CALCULATE (
        SUM ( C[Calc Qty] ),
        FILTER ( ALLSELECTED ( C ), [Prod. ID] IN _list )
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @OngS2,

You can try to use the following measure formula to summary records across different table fields based on conditions:

fomrula =
VAR _list =
    CALCULATETABLE (
        VALUES ( A[Prod. ID] ),
        FILTER (
            ALLSELECTED ( A ),
            COUNTROWS (
                FILTER ( ALLSELECTED ( B ), SEARCH ( [Model], [Item Name], 1, -1 ) > 0 )
            ) > 0
        )
    )
RETURN
    CALCULATE (
        SUM ( C[Calc Qty] ),
        FILTER ( ALLSELECTED ( C ), [Prod. ID] IN _list )
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Gokul_G16
Resolver I
Resolver I

Hi @OngS2 ,

I will do one thing , If you can have 3 type of scenario text conetnts. So for you can go and work back end in Power Qurery.
 -----
Select the A column then serach first  inside droptown like TW, then enter.
Select the A column then serach first  inside droptown like TC, then enter.
Select the A column then serach first  inside droptown like TR, then enter.

final you have 3 type of column like A , B , C.
Then apply and clsoe.
Post uploaded. Using
DAX = if (A=blank(), B,
if(B=blank(), C,
if(C=blank(), A, 0))).

try this by the way. if you feel with good kudos me :).


Have a good day.
gokul

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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