Created
December 11, 2017 19:20
-
-
Save malinxiao/5ed85e54f78b267c9543888d8ffe7038 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rank by OrderQty = | |
VAR IsProductFiltered = ISFILTERED('Product'[Product Name]) | |
VAR IsProductCategoryFiltered = ISFILTERED(ProductCategory[Product Category]) | |
RETURN | |
IF (IsProductFiltered && IsProductCategoryFiltered, | |
RANKX(ALL('Product'[Product Name]), CALCULATE(SUM(SalesOrderDetail[OrderQty]))), | |
IF (NOT IsProductFiltered && IsProductCategoryFiltered, | |
RANKX(ALL(ProductCategory[Product Category]), CALCULATE(SUM(SalesOrderDetail[OrderQty]))), | |
BLANK() | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment