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.
Hello,
I have a table with 3 columns, Customer Number, Account Number & Flag. I want to create a calculated column(NOT A MEASURE) which counts the number of accounts per customer when the flag is set to yes.
CustomerNumber AccountNumber Flag ExpectedOutput Actual Output
1 A1 Y 1 3
1 A2 N 1 3
2 A3 Y 2 3
2 A4 Y 2 3
I am using the following formula
Total Business Investment Products =
CALCULATE (
DISTINCTCOUNTNOBLANK ( 'Fact'[AccountNumber] ),
FILTER ( 'Fact', 'Fact'[Flag] = "Y" ),
ALLEXCEPT ( 'Fact', 'Fact'[CustomerNumber] )
)
Solved! Go to Solution.
Hi,
This calculated column formula works
=CALCULATE(COUNTROWS(Data),FILTER(Data,Data[CustomerNumber]=EARLIER(Data[CustomerNumber])&&Data[Flag]="Y"))
Hope this helps.
Hi,
This calculated column formula works
=CALCULATE(COUNTROWS(Data),FILTER(Data,Data[CustomerNumber]=EARLIER(Data[CustomerNumber])&&Data[Flag]="Y"))
Hope this helps.
Column = CALCULATE(COUNT(Data[AccountNumber]),ALLEXCEPT(Data,Data[CustomerNumber]),Data[Flag]="Y")
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 |
|---|---|
| 63 | |
| 45 | |
| 28 | |
| 24 | |
| 22 |