This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
The goal is to count transactions that were previously done but exclude any for the future. Ex: Count all transactions that happened in January 2023 but for February 2023 (and beyond), only Pizza transactions. I was successful in creating a filter that will only count Pizza transactions but I am confused on how I can get the January 2023 Sushi transaction to be counted (excluding Sushi February 2023 transactions and beyond). Below you will find sample data and expected output for context.
Your support is greatly appreciated.
Sample DAX Measure: I am aware that this filters out all Sushi transactions but confused on how to include just January 2023 and exclude any after
CALCULATE(
COUNT( trans_id )
,FILTER(
transactions
,transactions.product_code <> '200'
)
)
Sample Data
| trans_id | product_code | product | date |
| 1 | 100 | Cheese Pizza | 1-Jan-23 |
| 2 | 100 | Cheese Pizza | 2-Jan-23 |
| 3 | 200 | Sushi | 2-Jan-23 |
| 4 | 300 | Pineapple Pizza | 30-Jan-23 |
| 5 | 200 | Sushi | 3-Feb-23 |
| 6 | 100 | Cheese Pizza | 9-Feb-23 |
| 7 | 200 | Sushi | 20-Feb-23 |
| 8 | 300 | Pineapple Pizza | 22-Feb-23 |
| 9 | 300 | Pineapple Pizza | 25-Feb-23 |
| 10 | 200 | Sushi | 28-Feb-23 |
Expected Output: Notice that January 2023 Sushi transaction was counted but excluded from February 2023
| product_code | product | month_year | transaction_count |
| 100 | Cheese Pizza | Jan-23 | 2 |
| 200 | Sushi | Jan-23 | 1 |
| 300 | Pineapple Pizza | Jan-23 | 1 |
| 100 | Cheese Pizza | Feb-23 | 1 |
| 300 | Pineapple Pizza | Feb-23 | 2 |
Solved! Go to Solution.
@parry2k thank you so much for your support but I was able to rework some other measures and filters within my project to provide the expected output. Regarding your question, for this specific example...yes this logic is only applying towards "Sushi". But my true application will be filtering a few dozen more items.
@Anonymous You marked this post as solved, I guess you already have the solution, correct? From your last reply, it was not clear if you need further help or if you are good to go. 🤷♂️
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous one thing is not clear, is this logic only applied to sushi?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k thank you so much for your support but I was able to rework some other measures and filters within my project to provide the expected output. Regarding your question, for this specific example...yes this logic is only applying towards "Sushi". But my true application will be filtering a few dozen more items.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 62 | |
| 47 | |
| 28 | |
| 24 | |
| 20 |