Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a table of data that contains metrics for the year
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.
Solved! Go to 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
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])))
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
User | Count |
---|---|
93 | |
84 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |