Forum Discussion

Neel98's avatar
Neel98
Frequent Visitor
3 years ago
Solved

DAX: Pivot column

Hi, I need to create the pivoted column in Dax. Here I have attached the sample data. My dataset has a Number, date and value column. The final output will be Number and two date fields. Is this pos...
  • tamerj1's avatar
    tamerj1
    3 years ago

    Neel98 

    Please try

    NewTable =
    ADDCOLUMNS (
    VALUES ( 'Table'[Number] ),
    "5-Sep", CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = DATE ( 2022, 9, 5 ) ),
    "29-Sep", CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = DATE ( 2022, 9, 29 ) )
    )