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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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/

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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