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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Forrester
New Member

dax fixed count

Hello,

 

I am trying to get a fixed count for accounts under a customer so that I can apply 1 of 2 billing models (measure A for customers with 1 account, measure B for customers with >1 account).

 

Table  Results I'm Trying to achieve
CustomerAccount #ofAccountsMeasure to Use
11 2---use measure B
12 2---use measure B
21 1---use measure A
31 1---use meaure A
41 4---use meaure B
42 4---use meaure B
43 4---use meaure B
44 4---use meaure B
51 1---use meaure A
61 2---use meaure B
62 2---use meaure B

 

Problems:

Calculated Column Method:

If i create the #ofAccounts as a calculated column I am struggling to pull it into the billing measure:

Example: Billing:=IF([#ofAccounts]>1,[Measure B],[Measure A]) --Problem I cant refence {#ofAccounts) because its not reference customer

 

Measure Method:

#ofAccounts:=CALCULATE(DISTINCTCOUNT(Data[AccountId]))

This works if just looking at the measure, if I filter on customer 1 it returns a value of 2. However, when i try to apply the billing measure --Billing:=IF([#ofAccounts]>1,[Measure B],[Measure A])

it just reads off the account column and treats everything as a 1.

 

Thanks

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Forrester,

Problems:

Calculated Column Method:

If i create the #ofAccounts as a calculated column I am struggling to pull it into the billing measure:

Example: Billing:=IF([#ofAccounts]>1,[Measure B],[Measure A]) --Problem I cant refence {#ofAccounts) because its not reference customer 

 

Maybe you could try this formula:

Billing=IF(MAX([#ofAccounts])>1,[Measure B],[Measure A])

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Forrester,

Problems:

Calculated Column Method:

If i create the #ofAccounts as a calculated column I am struggling to pull it into the billing measure:

Example: Billing:=IF([#ofAccounts]>1,[Measure B],[Measure A]) --Problem I cant refence {#ofAccounts) because its not reference customer 

 

Maybe you could try this formula:

Billing=IF(MAX([#ofAccounts])>1,[Measure B],[Measure A])

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

Need source data sample/example. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.