Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Rank by Quarters solution

Dear all,

 

I would like to ask for your help on the below.  I would like to rank by months and Quarters.  I could do it for the months with the below formula. There are 2 different Tables the one with the amount and the one with the dates. But I have the dates on both tables if that helps(its connected with another table).

 

Rank = RankX(ALLSELECTED('Date'[Month/Yeart]); Calculate(SUM((('data-Table'[Amount])))))
 
But for the Quarter it does not work! i tried to do that but it appears only 1
 
RankQ = RANKX(ALL('Date'[Month/Yeart].[Quarter]);CALCULATE(sum('Data-Table'[Amount])))

 
the data source that I input is like below:
 
Date                        Amount       Type
01/01/2019              45.353.180    Gross Profit
01/02/2019              44.644.460    Gross Profit
01/03/2019              43.890.506    Gross Profit
01/04/2019              43.831.750    Gross Profit
01/05/2019              42.363.979    Gross Profit
01/06/2019              41.529.047    Gross Profit
 
Another solution that I thought is to create it with the below app.
 
 
But my problem here is that If i put in Thousands it does not appear the dots on the correct spot.
 
Let me know if you have any from the 2 solutions or if you need further info.
 
Thank you in advance.
 
  • Hi Anonymous,

     

    Please download the demo in the attachment. 

    1. Create columns for [Year] and [Quarter] in the date table. 

    2. Create a measure.

    ranks 2 =
    RANKX (
        ALL ( 'Date'[Year], 'Date'[Quarter] ),
        CALCULATE ( SUM ( Table1[Amount] ) ),
        ,
        ,
        SKIP
    )
    

    Rank-by-Quarters-solution

     

    Best Regards,
    Dale

2 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Anonymous,

     

    Please download the demo in the attachment. 

    1. Create columns for [Year] and [Quarter] in the date table. 

    2. Create a measure.

    ranks 2 =
    RANKX (
        ALL ( 'Date'[Year], 'Date'[Quarter] ),
        CALCULATE ( SUM ( Table1[Amount] ) ),
        ,
        ,
        SKIP
    )
    

    Rank-by-Quarters-solution

     

    Best Regards,
    Dale

    • Anonymous's avatar
      Anonymous
      Not applicable

      It worked! 

       

      Thank you very much!!!