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
Anonymous
Not applicable

How do i create a chart that shows me if something happens at least once in a variable time frame?

Hi, everyone. I have a single table with Users in it, and then a Participated field with a yes or no value in it. There is also a Date date and a Team field. Each record equals a single day for a single user. So a user in one month will have thirty records.10 users will have 300 records that month. etc.

 

My goal is to show a bar chart that has one bar for Group A and one bar for Group B. Group A is composed of 3 users and Group B is composed of 4 users. I want my bar chart to show the percent of users that have at least one yes for whatever date range is selected on the report. 

 

For example, if I pick January 1 & 2 (two days, but the example is the same if I picked a week or a year),  One of my group A users participated one day, did not participate the next. The second user participated both days. And the final user has all No values.

 

Team A for Jan 1 & 2:

User 1 Day 1 = Yes

User 1 Day 2 = No

User 2 Day 1 = Yes

User 2 Day 2 = Yes

User 3 Day 1 = No

User 3 Day 2 = No

 

So what I want is for the bar chart to show that 66% of my users participated and 34% did not. However, i can only get Power BI to show the overall count and percentages based on the number of occurences of Yes vs No. So in my example, it actually show 50% Yes and 50% No.

 

Any help would be most appreciated!

Scott 

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@Anonymous here's the table I used

Bart Chart - Table.png

and the result - includes the Measures

Bart Chart.png

You can just do the top or bottom left bar charts

 

for the ones on the right just Ctrl+C => Ctrl+V => change to 100% Stacked Bar

 

Hope this helps!

View solution in original post

4 REPLIES 4
dramus
Continued Contributor
Continued Contributor

Try using a measure like the one below:

 

Attended Number := countrows(filter(DataTable,'DataTable'[Attended]="Yes"))
Sean
Community Champion
Community Champion
Sean
Community Champion
Community Champion

@Anonymous here's the table I used

Bart Chart - Table.png

and the result - includes the Measures

Bart Chart.png

You can just do the top or bottom left bar charts

 

for the ones on the right just Ctrl+C => Ctrl+V => change to 100% Stacked Bar

 

Hope this helps!

Anonymous
Not applicable

Thanks @Sean and @dramus! Much appreciated! Part of why I am loving Power BI is that, when I get stuck on solving something, this community keeps me from having to go it alone!

 

Scott

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.