Forum Discussion

ChoiJunghoon's avatar
ChoiJunghoon
Icon for Helper III rankHelper III
6 years ago
Solved

[Q] Dax Create new table via using DAX

I want to create new table (blue).

NewTable =
Var x1=Selectedvalue(TableA[Value])

RETURN
SUMMARIZE
            (TableA, TableA[ID],"TYPE",
                                                CALCULATE(LASTNONBLANK(TableA[TYPE],1),FILTER(TableA,TableA[Value]=x1)
))

Could you please save me !! 

  • Are you trying to write a measure that will give your result in a table visual?  Or a DAX Calculated Table?  You've written a measure that uses a selectedvalue() which would not work for a calculated table.  If you want a calculated table, you could just use the Return part of your measure (with "=1", not "=x1", i assume that is a typo).

     

    If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

3 Replies

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    Are you trying to write a measure that will give your result in a table visual?  Or a DAX Calculated Table?  You've written a measure that uses a selectedvalue() which would not work for a calculated table.  If you want a calculated table, you could just use the Return part of your measure (with "=1", not "=x1", i assume that is a typo).

     

    If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

    • ChoiJunghoon's avatar
      ChoiJunghoon
      Icon for Helper III rankHelper III

      Thank you! you are right

       
      NewTable =
      SUMMARIZE(TableA,TableA[ID],"TYPE",CALCULATE(LASTNONBLANK(TableA[Type],1),FILTER(TableA,TableA[Value]=MaX(TableA[Value]))))