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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
PowerBINoob12
Helper I
Helper I

Dividing data by the number of months selected on a filter

I have a table of data that contains metrics for the year

PowerBINoob12_0-1681987677810.png


I want to create a measure that will sum all the values in the SLA column and then divide that my the number of months I select when I filter on month.

for example If I filter on Jan, March and Dec I want to add 86.26 + 87.65 + 86.85 and divide that by 3 (number of months selected on my drop down filter).

can anyone explain to me how to do the logic around dividing my the number of months selected in my filter please?

I have a calendar already set up as well if this helps.



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PowerBINoob12,

You can consider to use ALLSELECTED function to package and apply current filter effect to the Dax expression:

formula =
CALCULATE (
    DIVIDE ( SUM ( Table[SLA] ), COUNTROWS ( VALUES ( Table[Month] ) ) ),
    ALLSELECTED ( Table )
)

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
PowerBINoob12
Helper I
Helper I

Thought :

Would creating a column in my calendar that mapped the number 1 beside each month help?

example:

Sum(SLA) / (Countrows("MonthEquals1")

where the "monthEquals1" filter adds one for each month selected?

Hi,

Does this measure work

 

Measure = DIVIDE(SUM(Table[SLA]),COUNTROWS(ALLSELECTED(Table[Month])))

 


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

Hi @PowerBINoob12,

You can consider to use ALLSELECTED function to package and apply current filter effect to the Dax expression:

formula =
CALCULATE (
    DIVIDE ( SUM ( Table[SLA] ), COUNTROWS ( VALUES ( Table[Month] ) ) ),
    ALLSELECTED ( Table )
)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Kudoed Authors