Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

DAX to Pivot data

Hi,
I have 3 columns Amt, Row Date and Column date.  

 

 

I want to display the data as 

 

 

Looking for a help on DAX formula, how to do it. 

3 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    Hi Anonymous

     

    Can you please paste your sample data so we can make a measure that works perfectly for you.

     

      • Anonymous's avatar
        Anonymous
        Not applicable

        I got this working, but need help on fine-tuning the formula. 

        Note:- I have more than 35M records in my table.

         

        Def Revenue (M) =
        VAR Month_Start = SELECTEDVALUE('Fact - Table'[recognition_Date])
        VAR Earning = SELECTEDVALUE('Fact - Table'[earnings_Date])
        VAR End_Date = CALCULATE(MAX('Fact - Table'[earnings_Date]), ALL('Fact - Table'))

        RETURN

        IF(Month_Start = Earning, "" ,
        CALCULATE(
        SUM('Fact - Table'[earnings_amount]),
        'Fact - Table'[earnings_Date] > Month_Start
        && 'Fact - Table'[earnings_Date] >= Earning
        && 'Fact - Table'[earnings_Date] <= End_Date
        )
        )