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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello guys,
I want to create a column that counts the combinations of x and the relevant variable from column B. I know there is another way around but I'm interested in finding a way to do it with Dax.
Thanks.
A | B | ??? |
x | a | 3 |
x | b | 2 |
y | b | |
y | a | |
x | c | 1 |
z | c | |
x | a | 3 |
x | a | 3 |
x | b | 2 |
Solved! Go to Solution.
Hi @Anonymous
You can also try below codes
column =
COUNTROWS (
FILTER (
'Table (3)',
[A] = "x"
&& [A] = EARLIER ( 'Table (3)'[A] )
&& [B] = EARLIER ( 'Table (3)'[B] )
)
)
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi @Anonymous
You can also try below codes
column =
COUNTROWS (
FILTER (
'Table (3)',
[A] = "x"
&& [A] = EARLIER ( 'Table (3)'[A] )
&& [B] = EARLIER ( 'Table (3)'[B] )
)
)
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hello everyone,
This formula provided by @amitchandak works fine!
??? = if([A] ="X", countx(filter(Table, [A] =earlier([A]) && [B] =earlier([B])),[A]), blank())
Hi, @Anonymous
Please try the below DAX Measure.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.