Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
matthewtjy
Helper I
Helper I

Plotting a cumulative chart based on distinct counts

How do I plot a cumulative distinct count chart in PBI (like a running summation of distinct counts)?

 

I was able to find lots of information on cumulative summation charts however for my problem, I want to do it based on distinct count.

 

Example:

-There are 5 workplaces (A,B,C,D,E) that submits reports to me.

-So for example from beginning of time to 31 Dec 2014, I have only received reports from workplace E.

-Next, from beginning of time to 31 Dec 2015, I have received reports from workplaces B, E, G.

-I do not want to count how many reports were submitted to me, but rather how many distinct count of workplaces had submitted reports to me. So example in 2014, I would have 1 workplace; in 2015, I would have 3 workplaces.

 

-In the example data, column A is the workplace, column B is the date each report was submitted to me. So example in 2014, workplace A had submitted 6 reports. However, I would only want to count it once (because distinct count of workplace).

 

I apologise as I am totally new to Power BI but my boss wants me to self-learn.

 

Sorry, not sure how to upload a photo for quick reference.

 

Excel Workbook Example File 

1 ACCEPTED SOLUTION

@matthewtjy , Have year column in your table or use one from the Date hierarchy and try measure like

 

New column

Year = year([SUBMIT_DT])

 

New measure

Cumm Sales = CALCULATE(distinctcount('Table'[WORKPLACE_NO]),filter(allselected('Table'),'Table'[SUBMIT_DT] <=max('Table'[SUBMIT_DT])))

 

New measure with Date table, having year column

Cumm Sales = CALCULATE(distinctcount('Table'[WORKPLACE_NO]),filter(allselected('Date'),'Date'[Date] <=max('Date'[Date])))

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@matthewtjy , do you have a date or you can use the year in place of the date. You can try measure like

 

Cumm Sales = CALCULATE(distinctcount('Table'[workplaces ]),filter(allselected('Table'),'Table'[Date] <=max('Table'[Date])))

 

Yet to check your excel.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Sorry what do you mean by do I have a date? I would like to plot a chart based on the cumulative distinct count as at the end of each year e.g. end 2014, end 2015, end 2016, ..., all in 1 chart.

 

Sorry I'm not sure how else to explain it more simply, I'd post a screenshot of my excel file as it is easier to explain but I'm not sure how to upload a screenshot.

 

Thanks for replying though!

@matthewtjy , Have year column in your table or use one from the Date hierarchy and try measure like

 

New column

Year = year([SUBMIT_DT])

 

New measure

Cumm Sales = CALCULATE(distinctcount('Table'[WORKPLACE_NO]),filter(allselected('Table'),'Table'[SUBMIT_DT] <=max('Table'[SUBMIT_DT])))

 

New measure with Date table, having year column

Cumm Sales = CALCULATE(distinctcount('Table'[WORKPLACE_NO]),filter(allselected('Date'),'Date'[Date] <=max('Date'[Date])))

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

thanks!

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.