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

View all the Fabric Data Days sessions on demand. View schedule

Reply
AmeenVanakar
Advocate II
Advocate II

Want to add new column in a calculated table to show customer visits by range- Help Needed

Hi,

I want to add a new column to show customer visits based on their unique mobile number & unique invoices (i.e. their visits)

Where:

The distinct count of invoice number should match the below condition & show the result in a new column named "visits".

1 = 1 Visit

2 = 2 Visits

3 = 3 Visits

4 = 4 Visits

>=5 = More Than 5 Visits.

I also want to use these values as a filter in the report later, hence I want this in a column format.

 

I have attached the data snip for you to refer to.

Screenshot 1

AmeenVanakar_2-1727940409804.png

 

I also added a table with values (Screenshot 2) to show the range but I'm not sure how to bring this all together. Any help will be great.

Screenshot 2

AmeenVanakar_0-1727943388433.png

 

Customer data reference:

Customer ID = Customer mobile number

Invoice ID = Bill No

 

2 ACCEPTED SOLUTIONS
_AAndrade
Super User
Super User

Hi @AmeenVanakar,

I'm attaching my solution using Power Query.
I hope this can help you.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

Anonymous
Not applicable

Hi, @AmeenVanakar 

 

I've modeled some data to hopefully fit your situation.

Column:

Count = CALCULATE(COUNT('Table'[Unique invoices]),ALLEXCEPT('Table','Table'[Customer mobile number]))
Visit = 
IF([Count]>=5,CALCULATE(MAX(Range[Visits]),FILTER(Range,[Visit Range2]=1000000)),
CALCULATE(MAX(Range[Visits]),FILTER(Range,[Visit Range2]=EARLIER('Table'[Count]))))

vzhangtinmsft_0-1728368120727.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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
Anonymous
Not applicable

Hi, @AmeenVanakar 

 

I've modeled some data to hopefully fit your situation.

Column:

Count = CALCULATE(COUNT('Table'[Unique invoices]),ALLEXCEPT('Table','Table'[Customer mobile number]))
Visit = 
IF([Count]>=5,CALCULATE(MAX(Range[Visits]),FILTER(Range,[Visit Range2]=1000000)),
CALCULATE(MAX(Range[Visits]),FILTER(Range,[Visit Range2]=EARLIER('Table'[Count]))))

vzhangtinmsft_0-1728368120727.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

_AAndrade
Super User
Super User

Hi @AmeenVanakar,

I'm attaching my solution using Power Query.
I hope this can help you.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors