Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello everybody,
I create a measure Running in total by [Total Sales] ranking, in order to know top customers by % of sales.
But the performance is so slow. Can anyone have the idea or solution for this.
There are 2 measures that I'm using:
Customer RANK =
IF (
[Total Sales] > 0,
IF (
ISINSCOPE ( Customers[Code-Customer] ),
RANKX (
FILTER (
ALLSELECTED ( Customers[Code-Customer] ),
[Total Sales] > 0
),
[Total Sales]
)
)
)Total Sales Running In Total =
VAR CurrentRank = [Customer RANK]
VAR SummaryCustomers =
CALCULATETABLE (
VALUES ( Customers[Code-Customer] ),
FILTER ( ALLSELECTED ( Customers[Code-Customer] ), [Total Sales] > 0 )
)
VAR CustomerAndRank =
ADDCOLUMNS (
SummaryCustomers,
"@Sales", [Total Sales],
"@Rank", [Customer RANK]
)
VAR Result =
SUMX ( FILTER ( CustomerAndRank, [@Rank] <= CurrentRank ), [@Sales] )
RETURN
Result
Thanks very much.
@tannhq , Try like
Customer RANK =
RANKX (
FILTER (
ALLSELECTED ( Customers[Code-Customer] ),
[Total Sales] > 0
),
[Total Sales]
)
Total Sales Running In Total =
VAR CurrentRank = [Customer RANK]
VAR CustomerAndRank =
ADDCOLUMNS (filter( Sumamrize(Customers, Customers[Code-Customer] ),[Total Sales] > 0 )
SummaryCustomers,
"@Sales", [Total Sales],
"@Rank", [Customer RANK]
)
VAR Result =
SUMX ( FILTER ( CustomerAndRank, [@Rank] <= CurrentRank ), [@Sales] )
RETURN
Result
Also refer
Thanks @amitchandak ,
Your measure return the same number of total sales.
I try to add ALL (or ALLSELECTED) and the performance still is so slow.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 70 | |
| 39 | |
| 35 | |
| 23 |