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.
I have a query table as follows:
For the DAX expression, I used a quick measure with the formula as follows:
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
Ranking measure expected result: =
SWITCH (
TRUE (),
ISINSCOPE ( Data[Products] ),
RANKX (
ALL ( Data[Products] ),
CALCULATE ( SUM ( Data[Current volumn] ) ),
,
DESC
),
ISINSCOPE ( Data[Category] ),
RANKX (
ALL ( Data[Category] ),
CALCULATE ( SUM ( Data[Current volumn] ) ),
,
DESC
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hey @Dawn7047
the below screenshot shows the ranking for colors inside a brand:
Please be aware that also the Brands are ranked accordingly, I use this measure to create the above output:
Measure 4 =
if( ISINSCOPE('DimProduct'[ColorName] )
// the inner column (colorname) is ranked inside a group (brandname)
, RANKX(
CALCULATETABLE(
SUMMARIZE(
ALLSELECTED( 'FactOnlineSales' )
, 'DimProduct'[BrandName]
, 'DimProduct'[ColorName]
)
, VALUES( 'DimProduct'[BrandName] )
)
, CALCULATE( SUM( 'FactOnlineSales'[SalesAmount] ) )
)
// the outer column (brandname) is ranked
, RANKX(
CALCULATETABLE(
SUMMARIZE(
ALLSELECTED( 'FactOnlineSales' )
, 'DimProduct'[BrandName]
)
)
, CALCULATE( SUM( 'FactOnlineSales'[SalesAmount] ) )
)
)
Hopefully this provides what you are looking for.
Regards,
Tom
Hi,
Please check the below picture and the attached pbix file.
Ranking measure expected result: =
SWITCH (
TRUE (),
ISINSCOPE ( Data[Products] ),
RANKX (
ALL ( Data[Products] ),
CALCULATE ( SUM ( Data[Current volumn] ) ),
,
DESC
),
ISINSCOPE ( Data[Category] ),
RANKX (
ALL ( Data[Category] ),
CALCULATE ( SUM ( Data[Current volumn] ) ),
,
DESC
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |