Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Need help with measure

Hi guys,

I am trying to create a measure that would display monthend values on bar chart over time. I have a slicer on top for the users to select the date where the start date is fixed and end date is the newest date in the data.

On the bar chart I want to display month end for all the years and the end date in the slicer which won't be a month end. I am trying to achieve the same for financial year end where financial year end is 30th june.

 

So for example, if the dates in the slicer goes from 1st jan 2018 to 24th April, the monthly bar chart shuold have

31st Jan 2018, 28thFeb 2018 to 24th April 2019. And financial year end chart would have 30th june 2018, 24th April 2019.

Here is some sample data. Thanks for your help.

23/10/2018A                   3.0613.92
24/10/2018A                   3.0713.93
25/10/2018A                   3.0713.94
26/10/2018A                   3.0713.95
27/10/2018A                   3.0713.96
28/10/2018A                   3.0713.97
29/10/2018A                   3.0813.98
30/10/2018A                   3.0813.99
31/10/2018A                   3.0814
1/11/2018A                   3.0814.01
2/11/2018A                   3.0814.02
3/11/2018A                   3.0914.03
4/11/2018A                   3.0914.04
5/11/2018A                   3.0914.05
6/11/2018A                   3.0914.06
7/11/2018A                   3.1014.07
8/11/2018A                   3.1014.08
9/11/2018A                   3.1014.09
10/11/2018A                   3.1014.1
11/11/2018A                   3.1014.11
12/11/2018A                   3.1114.12
13/11/2018A                   3.1114.13
14/11/2018A                   3.1114.14
15/11/2018A                   3.1114.15
16/11/2018A                   3.1114.16
17/11/2018A                   3.1214.17
18/11/2018A                   3.1214.18
19/11/2018A                   3.1214.19
20/11/2018A                   3.1214.2
21/11/2018A                   3.1314.21
22/11/2018A                   3.1314.22
23/11/2018A                   3.1314.23
24/11/2018A                   3.1314.24
25/11/2018A                   3.1314.25
26/11/2018A                   3.1414.26
27/11/2018A                   3.1414.27
28/11/2018A                   3.1414.28
29/11/2018A                   3.1414.29
30/11/2018A                   3.1414.3
1/12/2018A                   3.1514.31
2/12/2018A                   3.1514.32
3/12/2018A                   3.1514.33
4/12/2018A                   3.1514.34
5/12/2018A                   3.1614.35
6/12/2018A                   3.1614.36
7/12/2018A                   3.1614.37
8/12/2018A                   3.1614.38
9/12/2018A                   3.1614.39
10/12/2018A                   3.1714.4
11/12/2018A                   3.1714.41
12/12/2018A                   3.1714.42
13/12/2018A                   3.1714.43
14/12/2018A                   3.1714.44
15/12/2018A                   3.1814.45
16/12/2018A                   3.1814.46
17/12/2018A                   3.1814.47
18/12/2018A                   3.1814.48
19/12/2018A                   3.1814.49
20/12/2018A                   3.1914.5
21/12/2018A                   3.1914.51
22/12/2018A                   3.1914.52
23/12/2018A                   3.1914.53
24/12/2018A                   3.2014.54
25/12/2018A                   3.2014.55
26/12/2018A                   3.2014.56
27/12/2018A                   3.2014.57
28/12/2018A                   3.2014.58
29/12/2018A                   3.2114.59
30/12/2018A                   3.2114.6
31/12/2018A                   3.2114.61
1/01/2019A                   3.2114.62
2/01/2019A                   3.2114.63
3/01/2019A                   3.2214.64
4/01/2019A                   3.2214.65
5/01/2019A                   3.2214.66
6/01/2019A                   3.2214.67
7/01/2019A                   3.2314.68
8/01/2019A                   3.2314.69
9/01/2019A                   3.2314.7
10/01/2019A                   3.2314.71
11/01/2019A                   3.2314.72
12/01/2019A                   3.2414.73
13/01/2019A                   3.2414.74
14/01/2019A                   3.2414.75
15/01/2019A                   3.2414.76
16/01/2019A                   3.2414.77
17/01/2019A                   3.2514.78
18/01/2019A                   3.2514.79
19/01/2019A                   3.2514.8
20/01/2019A                   3.2514.81
21/01/2019A                   3.2614.82
22/01/2019A                   3.2614.83
23/01/2019A                   3.2614.84
24/01/2019A                   3.2614.85
25/01/2019A                   3.2614.86
26/01/2019A                   3.2714.87
27/01/2019A                   3.2714.88
28/01/2019A                   3.2714.89
29/01/2019A                   3.2714.9
30/01/2019A                   3.2714.91
31/01/2019A                   3.2814.92
1/02/2019A                   3.2814.93
2/02/2019A                   3.2814.94
3/02/2019A                   3.2814.95
4/02/2019A                   3.2914.96
5/02/2019A                   3.2914.97
6/02/2019A                   3.2914.98
7/02/2019A                   3.2914.99
8/02/2019A                   3.2915
9/02/2019A                   3.3015.01
10/02/2019A                   3.3015.02
11/02/2019A                   3.3015.03
12/02/2019A                   3.3015.04
13/02/2019A                   3.3015.05
14/02/2019A                   3.3115.06
15/02/2019A                   3.3115.07
16/02/2019A                   3.3115.08
17/02/2019A                   3.3115.09
18/02/2019A                   3.3215.1
19/02/2019A                   3.3215.11
20/02/2019A                   3.3215.12
21/02/2019A                   3.3215.13
22/02/2019A                   3.3215.14
23/02/2019A                   3.3315.15
24/02/2019A                   3.3315.16
25/02/2019A                   3.3315.17
26/02/2019A                   3.3315.18
27/02/2019A                   3.3315.19
28/02/2019A                   3.3415.2
1/03/2019A                   3.3415.21
2/03/2019A                   3.3415.22
3/03/2019A                   3.3415.23
4/03/2019A                   3.3515.24
5/03/2019A                   3.3515.25
6/03/2019A                   3.3515.26
7/03/2019A                   3.3515.27
8/03/2019A                   3.3515.28
9/03/2019A                   3.3615.29
10/03/2019A                   3.3615.3
11/03/2019A                   3.3615.31
12/03/2019A                   3.3615.32
13/03/2019A                   3.3615.33
14/03/2019A                   3.3715.34
15/03/2019A                   3.3715.35
16/03/2019A                   3.3715.36
17/03/2019A                   3.3715.37
18/03/2019A                   3.3815.38
19/03/2019A                   3.3815.39
20/03/2019A                   3.3815.4
21/03/2019A                   3.3815.41
22/03/2019A                   3.3815.42
23/03/2019A                   3.3915.43
24/03/2019A                   3.3915.44
25/03/2019A                   3.3915.45
26/03/2019A                   3.3915.46
27/03/2019A                   3.3915.47
28/03/2019A                   3.4015.48
29/03/2019A                   3.4015.49
30/03/2019A                   3.4015.5
31/03/2019A                   3.4015.51
1/04/2019A                   3.4115.52
2/04/2019A                   3.4115.53
3/04/2019A                   3.4115.54
4/04/2019A                   3.4115.55
5/04/2019A                   3.4115.56
6/04/2019A                   3.4215.57
7/04/2019A                   3.4215.58
8/04/2019A                   3.4215.59
9/04/2019A                   3.4215.6
10/04/2019A                   3.4215.61
11/04/2019A                   3.4315.62
12/04/2019A                   3.4315.63
13/04/2019A                   3.4315.64
14/04/2019A                   3.4315.65
15/04/2019A                   3.4315.66
16/04/2019A                   3.4415.67
17/04/2019A                   3.4415.68
18/04/2019A                   3.4415.69
19/04/2019A                   3.4415.7
20/04/2019A                   3.4515.71
21/04/2019A                   3.4515.72
22/04/2019A                   3.4515.73
23/04/2019A                   3.4515.74
24/04/2019A                   3.4515.75
25/04/2019A                   3.4615.76
26/04/2019A                   3.4615.77
27/04/2019A                   3.4615.78
28/04/2019A                   3.4615.79

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Guys any inputs

  • v-danhe-msft's avatar
    v-danhe-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous ,

    I could not understand your below word:

    if the dates in the slicer goes from 1st jan 2018 to 24th April, the monthly bar chart shuold have

    31st Jan 2018, 28thFeb 2018 to 24th April 2019. And financial year end chart would have 30th june 2018, 24th April 2019.

    Could you please post your desired result if possible?

     

    Regards,

    Daniel He

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-danhe-msft 

       

      So in the current sample, my data range from 23/10/2018 to 27/04/2019. To get a flag for month end, I have created a calculated column 

      IsMonthEnd = IF((Sheet1[Date]= EOMONTH(Sheet1[Date],0))|| (Sheet1[Date]=MAX(Sheet1[Date])),"Yes", "No")

      which creates the following chart

       

       

       

      Now when I change the slicer to reflect the end date as 27/04/2019, the graph looks like below

       It ends on 31st march 2019 as the calculated column wouln't reflect this as month end which is correct. I am trying to ad an addtional bar to the above chart where it would show month end on 27th April 2019 as that is the end date in slicer which would require a measure. So even if I change the end date in slicer to 26th April 2019 then the last bar on the chart would show 26th April's result.

       

      I hope that clarifies a bit.

       

      Thanks

      • Anonymous's avatar
        Anonymous
        Not applicable

        BUMP