Forum Discussion

harshadrokade's avatar
harshadrokade
Post Partisan
6 months ago
Solved

Table visual with data from Data tab + measures

Hi,

 

I have below data. 

 

Project name1-May-251-Jun-251-Jul-251-Aug-251-Sep-251-Oct-251-Nov-251-Dec-251-Jan-26
A233914201417333536
B143728351435171226
C373140291412302425
D172437132927313315
E321840162415153633

 

I want to create a Table visual as below. he YTD and Estimated will be calculated values through measure. I am unable to understand how to add the calculated measures to the table visual. Can u pls help as I am new to this type of use case-

 

          YTDEstimated
Project name1-May-251-Jun-251-Jul-251-Aug-251-Sep-251-Oct-251-Nov-251-Dec-251-Jan-26 1-Mar-263-Apr-264-May-26
A23391420141733353636354022
B14372835143517122626143925
C37314029141230242525272119
D17243713292731331515272912
E32184016241515363333262326

12 Replies

  • I think this would be more obtainable using the Matrix visual rather than a Table visual, so you can group the months together better. 

    A possible solution could be to create a calculated column, and have it structured something like this:

    Period = 
    IF(
        'YourDateTable'[YourDateColumn] <= TODAY(),
        FORMAT('YourDateTable'[YourYearColumn],"yyyy"),
        "Future Period"
    )

    And put this column above your month column in the "Columns" section of your matrix. Then, write a measure that uses your YTD measure and your Estimated measure together with a similiar logic:

    YourNewMeasure = 
    IF(
        'YourDateTable'[YourDateColumn] <= TODAY(),
        YourYTDMeasure,
        Estimated
    )

    And put this in the "Values" section. For the "Rows" section, you can use the "Project Name" column. This should give you the expected results, however the "YTD" column would actually be the "Total" column for that subgroup but would accomplish the same goal.



      • Alex_Sawdo's avatar
        Alex_Sawdo
        Resolver II

        Lets say I have this subset of data (similiar to what you have, treated as estimation data) in conjuction with some real sales data from months that have already passed

        CustomerID1/1/20252/1/20253/1/20254/1/20255/1/20256/1/20257/1/20258/1/20259/1/202510/1/202511/1/202512/1/20251/1/20262/1/20263/1/20264/1/20265/1/20266/1/20267/1/2026
        C001

        7

        4

        8

        4

        9

        4

        8

        6

        4

        3

        7

        6

        12

        3

        10

        14

        4

        2

        1

        C002

        7

        3

        3

        4

        10

        1

        3

        3

        13

        3

        6

        1

        3

        5

        11

        11

        1

        0

        10

        C003

        2

        4

        5

        2

        1

        7

        6

        4

        11

        4

        5

        6

        4

        11

        11

        15

        13

        5

        5

        C004

        7

        5

        7

        7

        3

        4

        0

        2

        6

        5

        3

        2

        4

        2

        8

        3

        3

        8

        9

        C005

        1

        7

        0

        3

        13

        5

        7

        1

        11

        3

        6

        2

        0

        2

        7

        9

        11

        4

        7

        C006

        3

        2

        0

        2

        8

        3

        10

        3

        5

        3

        3

        1

        13

        2

        8

        3

        8

        7

        14

        C007

        1

        6

        9

        7

        2

        4

        15

        7

        11

        3

        1

        3

        6

        13

        0

        0

        6

        1

        0

        C008

        1

        7

        2

        7

        12

        4

        6

        3

        4

        2

        3

        7

        15

        1

        6

        15

        3

        3

        3

        C009

        6

        4

        9

        7

        1

        4

        5

        7

        10

        2

        4

        2

        10

        11

        13

        3

        6

        13

        2

        C010

        1

        2

        10

        1

        11

        6

        12

        2

        9

        2

        3

        6

        15

        14

        3

        3

        12

        14

        8

        Within Power Pivot (the "transform" section) I'll unpivot this data to be like this:

        CustomerIDDateEstimated Sales
        C0011/1/257
        C0012/1/254

        And here's my data model, after transformation and joins (Ensure the "Date" column in "Estimation Data" is a date and not text):

         

        Then write a measure calculating the total amount of estimated and actual sales and combine them into another measure (using my logic from the previous post):

        Sales + Estimations = 
        IF(
            SELECTEDVALUE(
                'Date'[Period]
            ) = "Future Period",
            [Estimated Sales],
            [Total Sales]
        )

         Then put it all into a matrix:

        For the desired output (with a few formatting changes):

        The real sales data will be used for anything that has already occured, and the estimates will be used for future dates. 

         

  • Hi,

    If Table 1 shows the shape of the input data table, then you will have to first "Unpivot Other Columns" in Power Query and then build a matrix visual.  But in the matrix visual, if you want to add 4 additional columns (YTD and the last 3 column of your Table 2), then you may have to use calculation groups.

    • harshadrokade's avatar
      harshadrokade
      Post Partisan

      Can u pls help me to understand how the calculation groups can help me to achieve this?

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        Could you share sample data and the logic of your forecast calculations. 

    • harshadrokade's avatar
      harshadrokade
      Post Partisan

      The data shared in oroginal post can be considered as the data