Forum Discussion
flaviobdsti
3 years agoHelper I
Calculation with virtual table
Hi guys! I hope they are fine! I need your help! I set up a virtual table (as shown in the image below) that shows the customer code and the total sum of sales grouped by customer. But I have di...
- 3 years ago
Hi,
I am not sure whether I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope the below can provide some ideas on how to create a solution for your data model.
Sales measure: = SUM( 'Table'[Sales] )Customer count over 30K: = COUNTROWS ( FILTER ( DISTINCT ( 'Table'[Code] ), [Sales measure:] >= 30000 ) )Top 5 customers sales: = CALCULATE ( [Sales measure:], KEEPFILTERS ( TOPN ( 5, ALL ( 'Table'[Code] ), [Sales measure:], DESC ) ) ) - 3 years agoJihwan_KimThank you very much, this is exactly what I need.
Jihwan_Kim
3 years agoSuper User
Hi,
I am not sure whether I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope the below can provide some ideas on how to create a solution for your data model.
Sales measure: =
SUM( 'Table'[Sales] )
Customer count over 30K: =
COUNTROWS ( FILTER ( DISTINCT ( 'Table'[Code] ), [Sales measure:] >= 30000 ) )
Top 5 customers sales: =
CALCULATE (
[Sales measure:],
KEEPFILTERS ( TOPN ( 5, ALL ( 'Table'[Code] ), [Sales measure:], DESC ) )
)
- flaviobdsti3 years agoHelper IJihwan_KimThank you very much, this is exactly what I need.