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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MuthalibAbdul
Helper II
Helper II

Average for each small multiple

MuthalibAbdul_1-1751914366701.png

 

I am trying to have individual monthly average for each location.

x axis is Calender[Month]

Y axis is FinalTable[Patient Name]

Small multiples is FinalTable[Location]

I cannot use sum since the patient name column is text. I tried count rows function but not able to figure out the code along with Month and Location

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @MuthalibAbdul 

It seems that you're using the average from "Add further analyses to your visual" which unforunately returns the average for all. If you want the average for each small multiple by month, create a measure

Monthly Average = 
AVERAGEX ( ALLSELECTED ( 'Date'[Month] ), [Row Count] )

Monthly Average Label = 
VAR _maxMonth =
    MAXX ( ALLSELECTED ( 'Date'[Month] ), [Month] )
RETURN
    IF ( SELECTEDVALUE ( 'Date'[Month] ) = _maxMonth, [Monthly Average] )

You'll need to use a custom data label to be able to show the label only for  a specific data point.

danextian_1-1751927185053.png

 

Please see the attached pbix

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

9 REPLIES 9
danextian
Super User
Super User

Hi @MuthalibAbdul 

It seems that you're using the average from "Add further analyses to your visual" which unforunately returns the average for all. If you want the average for each small multiple by month, create a measure

Monthly Average = 
AVERAGEX ( ALLSELECTED ( 'Date'[Month] ), [Row Count] )

Monthly Average Label = 
VAR _maxMonth =
    MAXX ( ALLSELECTED ( 'Date'[Month] ), [Month] )
RETURN
    IF ( SELECTEDVALUE ( 'Date'[Month] ) = _maxMonth, [Monthly Average] )

You'll need to use a custom data label to be able to show the label only for  a specific data point.

danextian_1-1751927185053.png

 

Please see the attached pbix

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

This solutions worked like a magic. THANK YOU!!! However, I am not able to position the average to the right of the bar. I labels at every change of month as shown below. I have tried going through your visual option by option and yet failed to contain the labels on the average bar. Can you help with this too?

The output you showed is exactly how I want my report to be. However I am not getting the same result. in the code above, what is [row count]?

Have you checked the pbix? The details are there. It's just the count of rows in a table. 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I am using this Version: 2.139.1678.0 64-bit (January 2025). The file you attached is not supported. 

lbendlin
Super User
Super User

This may be possible with a Deneb visual.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

burakkaragoz
Community Champion
Community Champion

Hi @MuthalibAbdul ,

 

Got it — since you're using Patient Name (a text column) on the Y-axis, you're likely trying to count the number of patients per month per location, right?

In that case, you can’t use SUM, but you can definitely use COUNTROWS or DISTINCTCOUNT depending on what you want to measure.

Here’s a DAX measure you can try:

Monthly Patient Count = 
CALCULATE(
    COUNTROWS(FinalTable),
    ALLEXCEPT(FinalTable, FinalTable[Month], FinalTable[Location])
)

Or, if you want to count unique patients:

Monthly Unique Patients = 
CALCULATE(
    DISTINCTCOUNT(FinalTable[Patient Name]),
    ALLEXCEPT(FinalTable, FinalTable[Month], FinalTable[Location])
)

Then use this measure on the Y-axis, with:

  • X-axis: Calendar[Month]
  • Small multiples: FinalTable[Location]

This will give you the monthly patient count per location, which is what I think you're aiming for.

Also, here’s a helpful doc on small multiples in Power BI:
🔗 https://learn.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-small-multiples

Let me know if you want to calculate averages instead of counts — happy to help with that too.

If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

This response was assisted by AI for translation and formatting purposes.

Thanks, I think we are still missing the monthly averages for each facility

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors