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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Syndicate_Admin
Administrator
Administrator

Count different customers but if they have not bought before

Good morning , everyone,

Thank you in advance for your attention. I have a question about how to count in a column. I give this example

Frangranada_0-1669366260509.png

If I want to count the number of customers who have bought on the 24th it is simple. I would have 6 customers with purchases that day. My problem comes as modeling in power bi if I wanted to calculate the number of customers who have purchased on the 24th but have not bought any previous day. That is, only 3 clients (customer 9, 8 and 5)

I hope I haven't messed up too much.

Thank you all again.

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi  @Syndicate_Admin 

Please try this,

create a date table, and put the column in slicer,

vxiaotang_0-1669622927845.png

then create a measure

Measure = 
var _date=SELECTEDVALUE('Date'[Date])
var _previous= CALCULATE(MIN('Table'[Date]),FILTER('Table','Table'[Value]>0))
return IF(_previous<_date,0,1)

and put the measure into visual-level filter, and set it to 1

vxiaotang_1-1669622985758.png

then when you select 24th, 

vxiaotang_2-1669623012281.png

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi  @Syndicate_Admin 

Please try this,

create a date table, and put the column in slicer,

vxiaotang_0-1669622927845.png

then create a measure

Measure = 
var _date=SELECTEDVALUE('Date'[Date])
var _previous= CALCULATE(MIN('Table'[Date]),FILTER('Table','Table'[Value]>0))
return IF(_previous<_date,0,1)

and put the measure into visual-level filter, and set it to 1

vxiaotang_1-1669622985758.png

then when you select 24th, 

vxiaotang_2-1669623012281.png

 

Best Regards,

Community Support Team _Tang

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

ddpl
Solution Sage
Solution Sage

@Syndicate_Admin ,

 

Create a calculated column and put it in a card...

 

count C = 

IF(
    Table1[11-24-2022] <> BLANK() && Table1[11-23-2022] = BLANK() && Table1[11-22-2022] = BLANK(),
    1
)

 

or you can create a measure and put it in a card...

count M = 

CALCULATE(
    COUNT(Table1[Client]),
    Table1[11-24-2022] <> BLANK(),
    Table1[11-23-2022] = BLANK(),
    Table1[11-22-2022] = BLANK()
)

Thanks for the answer, but if I have to take a whole year, how do I do? Creating the measure would be eternal

The idea is that if I mark in the power bi calendar a few days, I count only customers other than that date, but who have not purchased in the rest of the year, since January 1.

Maybe I didn't explain it well in the first message, sorry

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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