Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi team ,
I have category and month and sales count data .
1) i want to show Category and Month and Sales Count in tabular or matrix report
2) Along with this i want to show (Top 1 month - Sales ) - (Top 2 month - Sales ) as another column.
Filter :
I will use MOnth as filter so what ever the months i have choosen from filter from them measure need to dynamically pick up top 1 sales - top 2 sales .
Can any one help here through dax measure .
Solved! Go to Solution.
Hi @BalaVenuGopal,
Based on below sample table, please create measures:
S Sales = SUM('Monthly Sales'[Sales Count]) Rank Cat Month = RANKX ( ALLEXCEPT ( 'Monthly Sales', 'Monthly Sales'[Category] ), [S Sales], , DESC, DENSE ) Top1 = CALCULATE ( [S Sales], FILTER ( ALLEXCEPT ( 'Monthly Sales', 'Monthly Sales'[Category] ), [Rank Cat Month] = 1 ) ) Top2 = CALCULATE ( [S Sales], FILTER ( ALLEXCEPT ( 'Monthly Sales', 'Monthly Sales'[Category] ), [Rank Cat Month] = 2 ) ) Top1-Top2 = [Top1]-[Top2]
Best regards,
Yuliana Gu
Hi @BalaVenuGopal,
Based on below sample table, please create measures:
S Sales = SUM('Monthly Sales'[Sales Count]) Rank Cat Month = RANKX ( ALLEXCEPT ( 'Monthly Sales', 'Monthly Sales'[Category] ), [S Sales], , DESC, DENSE ) Top1 = CALCULATE ( [S Sales], FILTER ( ALLEXCEPT ( 'Monthly Sales', 'Monthly Sales'[Category] ), [Rank Cat Month] = 1 ) ) Top2 = CALCULATE ( [S Sales], FILTER ( ALLEXCEPT ( 'Monthly Sales', 'Monthly Sales'[Category] ), [Rank Cat Month] = 2 ) ) Top1-Top2 = [Top1]-[Top2]
Best regards,
Yuliana Gu
Hello,
I created this little table in a pbi file :
Then created 2 measures :
S Sales = SUM(Data[Sales])
Rank Cat Month = RANKX(ALL(Data[Category]);[S Sales])
You may then create a table with "Rank Cat Month" is less than 3
Hi @BalaVenuGopal,
Could you please provide more information about the request? Also, if you can provide sample data in excel along with sample output you are looking for. You can scramble data if it is confidential.
Thanks,
Rahul