Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Need help on the calculation

Hi Experts,

 

I needa help on the calculation.

 

Here is the example. I want o created a Column and display the latest data in the month.

 

Here, I want to created a Column as "YTD Act"  and display the latest values, i.e - in the sample data have been updated till Aug month column, so in the YTD Act column the values should be 

 

0

57

0

0

57

5

0

 

Please help me to acheive this.

Regards,

Swamy

 

6 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      No, I have created month column as calculated and i want to get the latest month's value.

       

      Regards

      swamy

      • JirkaZ's avatar
        JirkaZ
        Icon for Solution Specialist rankSolution Specialist

        Anonymous Why do you have it as a calculated column? Don't you have a date table in your model that you could use for that? Then the TOTALYTD would work.

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi, Anonymous 

    First, you must know that calculated column and calculate table can't be affected by any slicer. 
    Notice:
    1. Calculation column/table not support dynamic changed based on filter or slicer, It only be affected when refresh dataset.
    2. measure can be affected by filter/slicer, so you can use it to get dynamic summary result.
    here is reference:
    https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

    Second, What is your data structure in basic table, If Month columns are in one field and your screenshot is based on a matrix visual, Then it could be achieved like below:

    https://community.powerbi.com/t5/Desktop/Add-column-to-matrix-visual/td-p/600063

    If Month columns are different fields, your screenshot is just the data structure, your requirement couldn't be achieved directly.

    Since the "Month" column are just column name, It can't tell which column is the last month.

    So you may try to unpivot the Month columns data, then get it in matrix visual by the above solution.

     

    Regards,

    Lin