cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

How to get cumulative percentage with date filter on stacked column chart

I am working on a dataset where i need percentage of each category of surveys and I am using stacked bar chart to visualize the data 

 

I have date range filter, when i change date range to one particular month percentage the bar chart is not showing like i expected that means it's not 100% cumulative

 

For example ,

responseidcategorydate
1nflkjnsldknTop21/1/2020
23dffthrghfBottom21/2/2020
sdgfgdfgdfgmiddle21/3/2020
sdasgasdggTop21/4/2020
dfdgfhadvvBottom21/5/2020
cvbghrttsdTop21/6/2020
   

 

I have survey responses from 06/01/2019 to 06/012020 and I am using below DAX to caluclate the percentage 

 

TotalSurveys = DISTINCTCOUNT(Survey[responseid])
%ofCategory = DIVIDE([TotalSurveys],CALCULATE(DISTINCTCOUNT(Survey[responseid]),ALLSELECTED(Survey))) 
 
 
I am placing caterogy on legend and it's working as I expected if i select date range for all months.
 
I want to visualize the percentage of survey by category if i change my date filter to one month.
 
For example ..in the below screenshot I've 323 surveys in Jan 2020 and i want to visualize %of surveys by category with cumulative of 100%
 

Total surveys 3200 from Jun19 to Jun20Total surveys 3200 from Jun19 to Jun20there are 323 survey in Jan 2020there are 323 survey in Jan 2020

 

Is there any way that we can achieve this by using DAX ?

 

1 REPLY 1
Highlighted
Community Champion
Community Champion

Re: How to get cumulative percentage with date filter on stacked column chart

Do you have survey data for each of the categories in each of the months?  if yes then you can do a simple cumulative count against your dates table. If no then you need to use CROSSFILTER(survey date,dates date, none) to fill in the gaps.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Power BI Desktop August 2020 Update

Power BI Desktop August 2020 Update

We have great updates this month! Click the link for the video with more info.