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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ketan10
Advocate III
Advocate III

DAX Help Needed: Group values by transaction id and check class

I have a Table 1 using this I need to create a Table 2 as shown in the image below. I would appreciate any help with the logic on this to be done either using DAX or maybe in Tableau.  Thank you.

Note: If a transaction id has a class 'SP' then for that transaction id replace the class 'WSP' with 'SP' and then get the sum for that transaction id.


Screenshot (55).png

 

1 ACCEPTED SOLUTION

@ketan10

 

This Column for New Revenue

 

New Revenue =
CALCULATE (
    SUM ( TableName[Revenue] ),
    ALLEXCEPT ( TableName, TableName[Transaction ID] )
)

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

HI @ketan10

 

Try this Calculated Column

 

New Class =
IF (
    CALCULATE (
        COUNTROWS ( TableName ),
        FILTER (
            ALLEXCEPT ( TableName, TableName[Transaction ID] ),
            TableName[Class] = "SP"
        )
    )
        >= 1,
    "SP",
    TableName[Class]
)

@ketan10

 

This Column for New Revenue

 

New Revenue =
CALCULATE (
    SUM ( TableName[Revenue] ),
    ALLEXCEPT ( TableName, TableName[Transaction ID] )
)

Hi @Zubair_Muhammad Thank you. This works perfect !

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors