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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mstew55
Frequent Visitor

Count Unique Values based on another column, repeat value rows

Hello, i have one table. Same client name can repeat 50 times, but different records based on other rows. How can count the number of clients, with all blank rows in another column? some clients can have blank rows and non blank rows. But i want to see clients with all blank rows and no non blank rows in another column

12 REPLIES 12
mstew55
Frequent Visitor

Would this work in Power Pivot? also what if i wanted to add a date criteria? Example Greater than Date1 and less than Date2

 

mstew55
Frequent Visitor

Good Morning Yilong Zhou, I'm getting an error trying to use the above in calculated column

 

Anonymous
Not applicable

Hi @mstew55 ,

Like I mentioned in my earlier reply.

This is not a Calculated column, it is recreating a new table.

vyilongmsft_0-1729565342546.png

 

 

Best Regards

Yilong Zhou

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

mstew55
Frequent Visitor

Awesome Sauce!!!! WOrks perfectly! Is it possible to do it in a column, to indicate which client by row, did not have a sale?

Anonymous
Not applicable

Hi @mstew55 ,

I think you could try creating a new table to accomplish what you need.

Firstly I create a table as you mentioned.

vyilongmsft_0-1729479509796.png

Then you can choose to create a new table and here is the DAX code.

NewTable = 
VAR _ClientsWithSales = 
    SUMMARIZE(
        FILTER(
            'Table',
            'Table'[Sold] = "y"
        ),
        'Table'[Client]
    )
RETURN
DISTINCT(
    FILTER(
        'Table',
        NOT('Table'[Client] IN _ClientsWithSales)
    )
)

vyilongmsft_1-1729479616995.png

Again you can choose the form you want under Report view.

vyilongmsft_2-1729479828787.png

 

 

Best Regards

Yilong Zhou

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

mstew55
Frequent Visitor

Sorry 2 clients (Amber and Lacy)

hi @mstew55 ,

 

try like:

measure = 
COUNTROWS(
	FILTER(
		ADDCOLUMNS(
			VALUES(data[client]),
			"@sold", CALCULATE(MAX(data[sold]))
		),
		[@sold]=BLANK()
	)
)

 

it works like:

FreemanZ_0-1729264800530.png

 

mstew55
Frequent Visitor

Based on my example, it should be 1 client with No sales

mstew55
Frequent Visitor

As you can see some clients have mutilple products, with sales and no sales. I need to identify clients with no sales regardless of product. 

mstew55
Frequent Visitor

ClientProductSold
ChrisStrawberryy
Johnblackberryy
AmberCherrys 
ToddPeanutsy
ChrisHotdogs 
Chrishamburger 
JohnHotdogs 
Toddcookies 
AmberGranite 
BillIcecreamy
LacyWalnuts 
bennychairsy
Anonymous
Not applicable

Hi @mstew55 ,

I create a table as you mentioned.

vyilongmsft_0-1729219286860.png

Next I create a calculated column.

IsBlankColumnB = IF('Table'[ColumnB]=BLANK(), 1, 0)

vyilongmsft_1-1729219488169.png

Then I create a new table and a calculated column.

ClientSummary = 
SUMMARIZE(
    'Table',
    [ClientName],
    "TotalRows", COUNTROWS('Table'),
    "BlankRows", SUM('Table'[IsBlankColumnB])
)
AllBlankRows = IF([TotalRows] = [BlankRows], 1, 0)

vyilongmsft_2-1729219991706.png

Finally I think you can create another measure and it will give you what you want.

CountAllBlankClients = 
CALCULATE(
    COUNTROWS(ClientSummary),
    ClientSummary[AllBlankRows] = 1
)

vyilongmsft_3-1729220183633.png

 

 

Best Regards

Yilong Zhou

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

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.