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

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

Reply
Anonymous
Not applicable

Create Column on transactions Level based on transactions Level

Hi Community,

 

So what i am trying to achieve is the following:

 

TransactionIDItemIDR-PriceFLAG
37700791050546619198621.31Y
37700791050546618605421.3Y
3770079105054661860890Y
37700895050546617456425N
3770089505054669456322.5N

 

As you can see, i have a table with TransactionID, ItemID and the Sales Price (R-Price).

 

I need to create a FLAG column which can be used as a Filter to include or exclude all TransactionID's that have at least one item with a 0 value.

 

I have managed to achieve this in Power Query. However, the performances are slow. Can anyone give me any direction on how to do this in DAX?

 

Thanks,

 

Laz

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

@Anonymous,

 

You may refer to the DAX below.

Column =
CONTAINS (
    Table1,
    Table1[TransactionID], Table1[TransactionID],
    Table1[R-Price], 0
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may refer to the DAX below.

Column =
CONTAINS (
    Table1,
    Table1[TransactionID], Table1[TransactionID],
    Table1[R-Price], 0
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you for this 🙂

LivioLanzo
Solution Sage
Solution Sage

hI @Anonymous

 

what is the logic behing the flag? Are you extracting the data from a databse? this could be pused back to the database engine.

If you need to do this in Power Query, then it is faster if you create a mapping table with the logic built in and then create a Merge

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

Hi @LivioLanzo,

 

The logic is, we have some items in transactiosn which have a 0 Sales Value, which we identified as being the case due to a particular discount being used. So i want to do analysis with excluding all transactions whereby a single item has a 0 value. Thats the need for this flag.

 

Also, the database are coming from CSV Files. Currently that is exactly what i am doing, creating a lookup table with logic built in (corrrect keys to create merge) and then do a LEFT OUTER MERGE. 

 

However, it all works a tad slow which is why i am looking for altertive solutuons. This will make a lot more sense if you see the previous post which is in relation:

 

https://community.powerbi.com/t5/Desktop/Transformations-in-Power-Query-Very-Slow-Performance/m-p/58...

 

Thanks for your reply.

 

Laz

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors