Forum Discussion

hemingt's avatar
hemingt
Helper V
7 years ago

How to generate the cumulative data?

Hi, 

Here is my demo pbix file https://1drv.ms/u/s!AsM9bO8zGUN6qzaYABNrdAG8YQmr?e=yS7jfc

 

I use the measure to get the cumulative data, 

Cumulative Count = var __week = MAX('Sheet1'[Week]) return CALCULATE( COUNTROWS('Sheet1'), 'Sheet1'[Week] <= __week )
but I got blank data when there is no data at certain week. Jusk like the below table.
take the column Actual_End_Week as example, I want to get data as below.
1926 1
1927 1
1928 4
1929  6
1930 7
1931 7
1932 7
1933 7
1934 7
1935 7
1938 7
1939 7
1940 7
1941 7
1942 7
1943 7
1944 7
1945 8
 
Do you have any suggestion? Thank you!
 

2 Replies

    • hemingt's avatar
      hemingt
      Helper V

      Thank you very much RobbeVL 

      Your solution introduced another problem, I could not link the data of the Chart with the below table. 

      What I want is, when I click the data of the line chart, the table only show the relative records.

      Such as I click the Actual_End_Week of Week 1930, only the Actual_End_Week of Week 1930 should be listed in the table.