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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
VIrajMP
Frequent Visitor

Customer count with blank brokerage amount

Hi,

I am trying to get a count of customers who have given brokerage during the last month regardless of the customers giving brokerage in the current month. I have created 2 measures (TM Net Brokerage and LM Net Brokerage) as given below.

 

TM Net Brokerage =

IF(ISBLANK([Net Brokerage]),0,
           CALCULATE([Net Brokerage],
                 FILTER(Values(ActualswithTargetIncome[Partykey]),
                         IF([Net Brokerage] < 5000
                                 && [Net Brokerage LM] >= 25000, [Net Brokerage],BLANK())))
)
 
LM Net Brokerage =
IF(ISBLANK([Net Brokerage LM]),BLANK(),
                  CALCULATE([Net Brokerage LM],
                         FILTER(Values(Customer[CustomerNameCode]),
                                IF([Net Brokerage] < 5000
                                                && [Net Brokerage LM] >= 25000, [Net Brokerage LM],BLANK())))
)
 
NoofCustomers =
IF(ISBLANK([Net Brokerage]),1,
        COUNTROWS(
                       FILTER (
                         ADDCOLUMNS (
                                     VALUES ( ActualswithTargetIncome[Partykey] ),
                                          "NetBrok", CALCULATE ( [Net Brokerage] ),
                                          "NetBrokLM", CALCULATE([Net Brokerage LM])),
                                                           [NetBrok] < 5000  && [NetBrokLM] >= 25000 )
                               )
)
 
The visual below gives me the desired result when viewed by pcode, however I am unable to get the correct No of customers (when placed in a card visual) which in this case should be 8. I guess it ignores the blank cells (which I have replaced by 0 in the TM Net Brokerage) and counts only rows where the brokerage exists.
 

CountCustomers.png

I would like to have the count as 8, i.e. include the blanks, Will appreciate, if anyone could help me out with the dax measure to get the desired result.

 

Thanks and Regards

Viraj

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@VIrajMP , Try measures like

 

NoofCustomers = countx(values(Table[pcode]), if([TM Net Brokerage] =0 || isblank([TM Net Brokerage]) ,0,1))

NoofCustomers = countx(values(Table[customer ID]), if([TM Net Brokerage] =0 || isblank([TM Net Brokerage]) ,0,1))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @VIrajMP ,

 

Please refer to the links.

Dealing with Measure Totals 

Power BI: Totals Incorrect 

 

If the problem is still not resolved, please share the .pbix file or sample data.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@VIrajMP , Try measures like

 

NoofCustomers = countx(values(Table[pcode]), if([TM Net Brokerage] =0 || isblank([TM Net Brokerage]) ,0,1))

NoofCustomers = countx(values(Table[customer ID]), if([TM Net Brokerage] =0 || isblank([TM Net Brokerage]) ,0,1))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors