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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Nun
Resolver I
Resolver I

Get the name of customers from a count of customers in a category

Hello,

 

I have a table

Category Count of customer in the category Total sale

1               2                                                      5000

2               3                                                      7000  

3               5                                                      10000

Count of customer and total sales are formulas (which contain the filter of categories). Category is a table with only those categories. There is a table with customer name (A,B,C,D,E,F,G,H,I,L) and sale for each customer.

How can I get a table where instead to have the count , I ahve the name of the customer)

So 

Category    count   Total sale

1                 2          5000

 A

 B

2               3          7000

 C

 D

 F

Thanks in advance!

2 REPLIES 2
mh2587
Super User
Super User

//Create Table and Try this
CustFromCountCategory =
UNION(
    SELECTCOLUMNS('Category', "Category", 'Category'[Category], "Count", 'Category'[Count], "Total Sale", 'Category'[Total Sale]),
    SELECTCOLUMNS(
        FILTER('Sales', 'Sales'[Category] = EARLIER('Category'[Category])),
        "Customer", 'Sales'[CustomerName]
    )
)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Hello,

thanks for the quick response.

I try to explain it better

I have two table

Table 1 

Customer  Sales

A               1000

B                2000

C               1500

.....

Table 2

Category

1

2

3

4

Now to count how many customers fall in category 1,2,..., I created a formula: "count of customer", to know the total sales fall in category 1,2,,,I created a formula.

In practice these is not a field category in Table1 as well there is not a field count or total sales in Table 2

Thanks!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.