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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.