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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
perplexedDev
Regular Visitor

Average of result grouped by dates

I have a table of the format

Date    Result

4/11     F

4/11     F

4/12     P

4/12     F

4/12     P

 

I need to get the average of pass and fail records per date to plot a chart as below

Date    PassAvg   FailAvg

4/11     0               100%(i.e,2*100/2)

4/12     66.6%       33.3% 

 

How can I achieve this?

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@perplexedDev

There's 2 ways to do this. I'll give you both because inevitably someone will read this and try to give you the easy way...

 

First (not the way I would do it - but its faster)

You need to write only 1 Measure - and create a Matrix - place fields as in the picture!

Matrix - Quick.png

 

Second you have to write 5 simple Measures but it gives you more flexibilty later on... for other visualiazations including charts

Table.png

I may post a chart later which you can't do with the first method

Hope this helps!

View solution in original post

5 REPLIES 5
Sean
Community Champion
Community Champion

@perplexedDev

There's 2 ways to do this. I'll give you both because inevitably someone will read this and try to give you the easy way...

 

First (not the way I would do it - but its faster)

You need to write only 1 Measure - and create a Matrix - place fields as in the picture!

Matrix - Quick.png

 

Second you have to write 5 simple Measures but it gives you more flexibilty later on... for other visualiazations including charts

Table.png

I may post a chart later which you can't do with the first method

Hope this helps!

calerof
Impactful Individual
Impactful Individual

Hi,

But what about the dates grouping, in this case by day?

Fernando

 

The secod solution works perfectly. I had one question though, how did you add the percentage sign for Avg measures?

Modeling Tab => Format: => select Percentage

Format.png

Thank you so much. Sorry for my ignorance,I am new to excel and power BI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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