Forum Discussion

JDartz's avatar
JDartz
Frequent Visitor
4 months ago
Solved

Issues with First/Last Sorting on Matrix Table Column

I have a Matrix Table Column that seems to be sorting inconsistently for a column of data.

 

Essentially, I have a column of text that is capturing a number and I need the last number of the sub-rows to show on the master row. The problem I have is that when I set the data for LAST, there are some master rows data points that show the correct data point, but others are not (see first photo). 

Conversley, if I change the data to show FIRST, some of the last data points now show in the Master Row (see second photo)

Any suggestions on what may be the issue?

 

 

  • JDartz here is the measure, change the column and table name as per your model, use display value measure in the matrix.

     

    Sum = SUM ( YourTable[YourColumn] ) 
    
    DIsplay Value = 
    IF ( 
        ISINSCOPE ( 'YourTable'[Date] ), [Sum],
        LASTNONBLANKVALUE ( 'YourTable'[Date], [Sum] )
       
    )

     

  • For your reference.

     

    Step 0: I use these DATA below.

     

    Step 1: I Make a Measure and a Matrix below.

    M_LastDateValue = CALCULATE(MAX('DATA'[No]),FILTER('DATA','DATA'[Date]=CALCULATE(MAX('DATA'[Date]),ALLEXCEPT('DATA',DATA[Office Name]))))

     

     

     

     

     

     

7 Replies

  • For your reference.

     

    Step 0: I use these DATA below.

     

    Step 1: I Make a Measure and a Matrix below.

    M_LastDateValue = CALCULATE(MAX('DATA'[No]),FILTER('DATA','DATA'[Date]=CALCULATE(MAX('DATA'[Date]),ALLEXCEPT('DATA',DATA[Office Name]))))

     

     

     

     

     

     

  • JDartz, the last one in this case is not based on the date; it is the highest value. I guess your ask is to get the data of the latest date for each office, is this correct? If that is the case, I need to write a measure that I can help with once I know what the end goal is. 

    • JDartz's avatar
      JDartz
      Frequent Visitor

      parry2k - You're correct; I was looking to have the latest data point show on the master row.

  • JDartz ok, got it. Location (Office) and Dates, are they in a different dimension table, or everything from a single table? It changes how the measure will be done.

  • JDartz here is the measure, change the column and table name as per your model, use display value measure in the matrix.

     

    Sum = SUM ( YourTable[YourColumn] ) 
    
    DIsplay Value = 
    IF ( 
        ISINSCOPE ( 'YourTable'[Date] ), [Sum],
        LASTNONBLANKVALUE ( 'YourTable'[Date], [Sum] )
       
    )

     

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi JDartz ,

    Thank you mickey64 , parry2k  for your inputs.
    We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.

    Thank you.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi JDartz ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.