I have two tables of data:
1.Fact:
ImaginaryFact =
DATATABLE (
"FruitKey", INTEGER,
"Amount", INTEGER,
{
{ 1, 1 },
{ 1, 5 },
{ 1, 2 },
{ 2, 2 },
{ 2, 3 },
{ 3, 4 },
{ 3, 5 },
{ 4, 2 },
{ 5, 2 },
{ 6, 3 },
{ 7, 8 }
} )
2.Dimension:
Dimension =
DATATABLE (
"FruitKey", INTEGER,
"Fruit", STRING,
"Colour", STRING,
{
{ 1, "Apple", "Green" },
{ 6, "Apple", "Blue" },
{ 7, "Apple", "Red" },
{ 2, "Pear", "Pink" },
{ 3, "Orange", "Green" },
{ 4, "Kiwi", "Green" },
{ 5, "Mango", "Green" }
} )
With this simple join:
Then I created these two measures:
Amount = SUM( ImaginaryFact[Amount] )
Rank Fruity =
IF(
ISFILTERED( 'Dimension'[Colour] ),
RANKX( ALLSELECTED( 'Dimension'[Colour] ), [Amount] ),
IF(
ISFILTERED( 'Dimension'[Fruit] ),
RANKX( ALLSELECTED( 'Dimension'[Fruit] ), [Amount] )
)
)
If I create a 'Matrix' then the measure 'Rank Fruity' means I can move up and down between Fruit and Colour and the rank still works AND it blanks out the Total row which I wanted as that row is not filtered:
HERE IS THE PROBLEM When I drill down the hierarchy I want to return blanks for the subtotals same as the Grand Total row is blank ...
Amount
subtotals, right? – Alexis Olson