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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jbuzaglu
Frequent Visitor

How to group by transaction ID and Tag

Hi all, so I have a unit table that brings sales data (including item IDs on each transaction, so I may have more than 2 rows per transactions). I have already grouped by transactions on another table, but I need to create a column on the other table thats tags whether a transaction contains a unit that was "yes" for GWP. So basically, when one of the units inside a transaction has GWP "Yes", that transaction should be classified as GWP transaction.

1 ACCEPTED SOLUTION

For a column, you can try like this?

Is GWP Transaction = 

var _TxID = 'Table1'[Transaction Number]
var _IsGWP = IF ( COUNTROWS( FILTER( all('Table1'), 'Table1'[Transaction Number] = _TxID && 'Table1'[GWP Unit] = "Yes")) > 0, "Yes", "No")

Return _IsGWP

View solution in original post

4 REPLIES 4
jbuzaglu
Frequent Visitor

THANK YOU SO MUCH!!!! This worked like a charm!!!

Glad it worked 😊

jbuzaglu
Frequent Visitor

jbuzaglu_0-1683313013359.png

 

For a column, you can try like this?

Is GWP Transaction = 

var _TxID = 'Table1'[Transaction Number]
var _IsGWP = IF ( COUNTROWS( FILTER( all('Table1'), 'Table1'[Transaction Number] = _TxID && 'Table1'[GWP Unit] = "Yes")) > 0, "Yes", "No")

Return _IsGWP

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.