This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hello Experts!
I hope you're able to help me out here... I am relatively new to Power BI and DAX but will try my best to explain.
I am trying to determine the amount of Users either by a calculcated column via DAX with the following logic or through another method (am open to feedback and suggestions):
| Region | User | Method of Purchase | Items Purchased |
| ON | Bob | A | 2 |
| ON | Bob | A | 2 |
| ON | Bob | A | 2 |
| ON | Bob | B | 7 |
I've created a table via DAX using SUMMARIZE, and created a calculcated column using DAX to formulate:
COLUMN =
var _value =
IF (AND(
TableName[MethodOfPurchase] = "A", TableName[ItemsPurchased] > 7), 0,
IF (AND(TableName[MethodOfPurchase] = "B", TableName[ItemsPurchased] >=7), 1, BLANK())
)
RETURN _value
| Region | User | Method of Purchase | Items Purchased | Column |
| ON | John | A | 2 | |
| ON | John | B | 8 | 1 |
Solved! Go to Solution.
Hi @zhangb94 ,
According to your description, here is my solution.
Since the sample data you gave does not match the expected output you wanted, I create a new sample based on your description.
Create a column.
Column =
IF (
COUNTROWS (
FILTER (
'Table',
'Table'[User] = EARLIER ( 'Table'[User] )
&& [Method of Purchase] = "A"
)
) > 0
&& COUNTROWS (
FILTER (
'Table',
'Table'[User] = EARLIER ( 'Table'[User] )
&& [Method of Purchase] = "B"
)
) > 0,
0,
IF (
COUNTROWS (
FILTER (
'Table',
'Table'[User] = EARLIER ( 'Table'[User] )
&& [Method of Purchase] = "B"
&& [Items Purchased] >= 7
)
) > 0,
1
)
)Final output:
Best Regards,
Community Support Team _ xiaosun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @zhangb94 ,
According to your description, here is my solution.
Since the sample data you gave does not match the expected output you wanted, I create a new sample based on your description.
Create a column.
Column =
IF (
COUNTROWS (
FILTER (
'Table',
'Table'[User] = EARLIER ( 'Table'[User] )
&& [Method of Purchase] = "A"
)
) > 0
&& COUNTROWS (
FILTER (
'Table',
'Table'[User] = EARLIER ( 'Table'[User] )
&& [Method of Purchase] = "B"
)
) > 0,
0,
IF (
COUNTROWS (
FILTER (
'Table',
'Table'[User] = EARLIER ( 'Table'[User] )
&& [Method of Purchase] = "B"
&& [Items Purchased] >= 7
)
) > 0,
1
)
)Final output:
Best Regards,
Community Support Team _ xiaosun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
your sample data does not match the expected output. Please check.
Thanks for your response. Updated DAX:
COLUMN =
var _value =
IF (AND(
TableName[MethodOfPurchase] = "A", TableName[ItemsPurchased] < 7), 0,
IF (AND(TableName[MethodOfPurchase] = "B", TableName[ItemsPurchased] >=7), 1, BLANK())
)
RETURN _value
SHOULD yield the results in "COLUMN"
| Region | User | MethodOfPurchase | ItemsPurchased | Column |
| ON | Bob | A | 2 | 0 |
| ON | Bob | A | 2 | 0 |
| ON | Bob | A | 2 | 0 |
| ON | Bob | B | 7 | 1 |
Check out the April 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 |
|---|---|
| 34 | |
| 31 | |
| 30 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 63 | |
| 53 | |
| 31 | |
| 23 | |
| 23 |