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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
bvanderwatt
Helper III
Helper III

Additional filter to restrict data to pull from a certain column

Good Day 

 

I am using the below formula to identify the first date in a product is purchased. 

 

However, I need to add another filter to restrict the data to only pull from a certain column called "Inv+Order." 

 

Based on the below formula, it's including my budgeted quanties. 

 

Any help will be much appreciated. 

@TheoC 

 

FirstTransactionDate =
CALCULATE (
FIRSTDATE ( 'Combined Sales'[InvoiceDate] ),
FILTER ( 'Combined Sales', 'Combined Sales'[StockCode] = EARLIER ( 'Combined Sales'[StockCode]
) ))

 

bvanderwatt_0-1655248392578.png

 

 

2 REPLIES 2
TheoC
Super User
Super User

Hi @bvanderwatt 

 

You should be able to integrate ALLEXCEPT into your filters, something along the lines of:

 

FirstTransactionDate =

CALCULATE (
FIRSTDATE ( 'Combined Sales'[InvoiceDate] ) ,
FILTER ( ALLEXCEPT ( 'Combined Sales' , 'Combined Sales'[Inv+Order] ) , 'Combined Sales'[StockCode] = EARLIER ( 'Combined Sales'[StockCode] )
)
)
 
Hopefully that helps!  Haven't tested syntax so keep me posted.
 
Theo 🙂
 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Thank you so mcuh for helping me. I reaaaaally appreciate it. I've been struggling for about 5 hours since you came along 🙂 

 

I've added the calculated column, but i dont understand why it's giving me different "first transaction" dates for the  exact same product. The formula is supposed to give me the first transaction date of when the product was sold. 

 

Also, would it be possible to exclude a certain customer class called "exclude" from this formula. Sometimes I send samples and I've excluded those accounts in my customer class. 

 

bvanderwatt_2-1655249841388.png

 

FirstTransactionDate =
CALCULATE (
FIRSTDATE ( 'Combined Sales'[InvoiceDate] ),
FILTER (
ALLEXCEPT (
'Combined Sales' ,
'Combined Sales'[Inv+Order] ) ,
'Combined Sales'[StockCode] = EARLIER ( 'Combined Sales'[StockCode] ) ) )

 

bvanderwatt_0-1655249620369.png

 

bvanderwatt_1-1655249821767.png

 

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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