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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bomman
Frequent Visitor

Sorting sales data by the number of month sales

Hello guys, I have got the following problem: I cannot filter my data by the number of month sales. I have got colums: 
- Client_Num

- Client_Name

- Invoice

- Month

- Year
- NetAmount (net amount of sales)

I would like to creat a filter to find my loyal clients.
For example, if i choose 5 as number of month sales, then I want a table with clients with more than 5 sales per month.

1 ACCEPTED SOLUTION

Hi @bomman,

You create a new table including 1,2 ,3......10. Then add it as slicer.

Create a calculated column using the formula. distinct=DISTINCTCOUNT(Table[invoice])

Then create another measure, new-measure=CALCULATE(sum(Table[sales]), FILTER(Table,Table[disticnt]>=5))

Finally, create a table visual shows the information and new-measure.

Best Regards,
Angelia

View solution in original post

3 REPLIES 3
v-huizhn-msft
Employee
Employee

Hi @bomman,

I create the following sample table, try to reproduce your scenario.

1.PNG

1. I create a new table including [NetAmount], named it as Table2. Please notice there is no relationshiop between Table2 and Table1 above.

2. Then create a slicer including Table2[NetAmount], create a measure to get the selected value in slicer.

selectvalue = MAXX(ALLSELECTED(Table2),Table2[NetAmount])

 

3. Create a measure to get the NetAmount larger than selected in slicer, create a table visual to show the client name and NetAmount.

NewNetAmount = CALCULATE(MAX(Table1[NetAmount]),FILTER(Table1,Table1[NetAmount]>=Table2[selectvalue]))

1.PNG
You can use the similar method to get your expected sales based on your resource table. Please download the attachment to test.

Best Regards,
Angelia

 

 Hello @v-huizhn-msft,

 

Thanks but it is not what I need. You create a slicer by net amount. I want to filter by number of sales. 
Another examples:

 

Client A has 4 distinct invoices for february, which means 4 sales, for $15.
Client B has 2 distinct invoices for february, which means 2 sales, for $43.
Client C has 7 distinct invoices for february, which means 7 sales, for $27.

I want a filter from 1 to 10, for example, and if I choose 5 sales per month, then to show me information only about Client A and Client C.

Todor

Hi @bomman,

You create a new table including 1,2 ,3......10. Then add it as slicer.

Create a calculated column using the formula. distinct=DISTINCTCOUNT(Table[invoice])

Then create another measure, new-measure=CALCULATE(sum(Table[sales]), FILTER(Table,Table[disticnt]>=5))

Finally, create a table visual shows the information and new-measure.

Best Regards,
Angelia

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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