Forum Discussion

MRAMS's avatar
MRAMS
New Member
2 years ago
Solved

Formula Help

Hi all,

 

I am new to Power BI Desktop and have managed to do all other formula's except this one.  If someone could help it would be greatly appreciated. 

 

My formula in excel adds up all the values in column 1 if the name is the same in column 2 and returns the total of all rows in each row.  This then enables me to pick up the max unavailable days.

 

No matter what I try in Power BI I cannot get a formula to work.  I have tried doing it in the query, in the data table and as a measure, but nothing works.  Help please.

 

Thank you in advance.

 

Michelle

 

DNU – Unavailable Days MCRQ                 FE & Week Start Date MCRQ                      NEW Column
1                             KLA – 10/04/2023                                            3
1                             KLA – 10/04/2023                                            3
1                             KLA – 10/04/2023                                            3
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi MRAMS 

    You can create a calculated column

    Column = SUMX(FILTER('Table',[FE & Week Start Date MCRQ]=EARLIER('Table'[FE & Week Start Date MCRQ])),[DNU – Unavailable Days MCRQ])

    Output

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

4 Replies

Replies have been turned off for this discussion
  • KNP's avatar
    KNP
    Super User

    Hi Michelle,

     

    Wouldn't you rather just calculate the 'Max Unavailable Days' as a measure or do you need this column for something else?

     

    Some additional data with more combinations would be useful.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi MRAMS 

    You can create a calculated column

    Column = SUMX(FILTER('Table',[FE & Week Start Date MCRQ]=EARLIER('Table'[FE & Week Start Date MCRQ])),[DNU – Unavailable Days MCRQ])

    Output

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • MRAMS's avatar
      MRAMS
      New Member

      Hi Anonymous 

      This formula has worked.  Thank you so much for your help.  

      Thanks,

      Michelle

       

      Michelle