Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Table with Dynamic Column

I have a table which needs to use a user's selection on a calculated column. The calculated column is used to calculate another columns.

I know is not possible to create columns with measures or dynamic values, so I'm trying to figure out a way to calculate this column with measures.

I already tried using a measure for the calculated column (below) and them using that measure to calculate another columns I need as measures.

"measure Data Considerada ABERTO" = EOMONTH(MAX('Table2'[ReferenceDate]), 0) + 3.

The result for both static and dynamic table (with measures) are show below.

The problem is that that I have some categories, and I need to summarize the table by them as a sum of each column. But instead of counting, it seems to be getting the first value of each category "Centro" (desconsidering the Date Column), as you can see below. What should I do to get the total value?

  • Hi, Anonymous 

     

    Is this the result you expect? There is no direct relationship to the date column.

     

    Best Regards,

    Community Support Team _Charlotte

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

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

    This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

    Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
    https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

    Also: https://youtu.be/uXRriTN0cfY
    And: https://youtu.be/n4TYhF2ARe8

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

    Hi, Anonymous 

     

    Based on the data you provided, can you give 2 examples of what your desired output is? Sensitive information can be removed in advance. You can also show it with Excel.

     

    Best Regards,

    Community Support Team _Charlotte

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-zhangti 

       

      Refer to this sample, please.

       

      User input: 30/04/2022

      "Data Considerada" = "User input" + 3
      "O-Q" = "Data Considerada" - "Data-base fim"

       

      Input:

      Order ID   Category   Data-base fim   Data Considerada   O-Q   B Plan   Critico   B Critico   
      100104/10/202103/05/2022211101
      200124/01/202203/05/202299100
      300124/01/202203/05/202299100
      400114/03/202203/05/202250101
      500107/03/202203/05/202257100
      600123/11/202103/05/2022161100
      700120/11/202103/05/2022164110
      800208/11/202103/05/2022176100
      900206/12/202103/05/2022148100
      1000206/12/202103/05/2022148100
      1100213/12/202103/05/2022141110
      1200215/11/202103/05/2022169110
          Total1232

       

      Output

      Category   Sum of B Plan   Sum of Critico   Sum of B Critico   
      001712
      002520
      Total1232

       

      It doesn't need necessarily to show total on the table.

      What I do need is a total to show in a card visual. But if a insert "B Plan" in a card, for example, it doens't show the total = 12.

      I also need these results to sum to another measures from another table.

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

        Hi, Anonymous 

         

        Is this the result you expect? There is no direct relationship to the date column.

         

        Best Regards,

        Community Support Team _Charlotte

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