Forum Discussion
Calculating Total by Measure
- Anonymous9 years ago
dkushner wrote:
Thanks, it’s working. now one more question.
If I need to implement 1 more filter by measure (I need to select exact Counters from the column). What should I do?
Or how can I use a filter directly in the formula. For example I would like to calculate Total Delta by Aplus only for 2 counters with the numbers 18 and 50.
Hi dkushner,
Please check that if the following DAX returns your expected result.
sumdelta = SUMX(VALUES(PowerCounters[CounterNumber]), [Delta by Aplus])
Total Delta = CALCULATE([sumdelta],FILTER(PowerCounters,PowerCounters[CounterNumber]= "18"||PowerCounters[CounterNumber]= "50"))However, if you want to calculate SUM of “Delta by Aplus” in a specific date range, create a date column using following DAX.
Date = DATE(YEAR(PowerCounters[DateT]),MONTH(PowerCounters[DateT]),DAY(PowerCounters[DateT]))
Then create the following measures, specify date range in the filter of Total Delta measure.
sumdelta = SUMX(VALUES(PowerCounters[CounterNumber]), [Delta by Aplus])
Total Delta = CALCULATE([sumdelta],FILTER(PowerCounters,PowerCounters[Date]<=DATE(2017,3,29) && PowerCounters[Date]>=DATE(2017,3,28)))
Thanks,
Lydia Zhang
Total Delta := SUMX(VALUES(PowerCounters[CounterNumber]), [Delta by Aplus])
- dkushner9 years agoFrequent Visitor
Thanks, it’s working. now one more question.
If I need to implement 1 more filter by measure (I need to select exact Counters from the column). What should I do?
Or how can I use a filter directly in the formula. For example I would like to calculate Total Delta by Aplus only for 2 counters with the numbers 18 and 50.
- Anonymous9 years agoNot applicable
dkushner wrote:
Thanks, it’s working. now one more question.
If I need to implement 1 more filter by measure (I need to select exact Counters from the column). What should I do?
Or how can I use a filter directly in the formula. For example I would like to calculate Total Delta by Aplus only for 2 counters with the numbers 18 and 50.
Hi dkushner,
Please check that if the following DAX returns your expected result.
sumdelta = SUMX(VALUES(PowerCounters[CounterNumber]), [Delta by Aplus])
Total Delta = CALCULATE([sumdelta],FILTER(PowerCounters,PowerCounters[CounterNumber]= "18"||PowerCounters[CounterNumber]= "50"))However, if you want to calculate SUM of “Delta by Aplus” in a specific date range, create a date column using following DAX.
Date = DATE(YEAR(PowerCounters[DateT]),MONTH(PowerCounters[DateT]),DAY(PowerCounters[DateT]))
Then create the following measures, specify date range in the filter of Total Delta measure.
sumdelta = SUMX(VALUES(PowerCounters[CounterNumber]), [Delta by Aplus])
Total Delta = CALCULATE([sumdelta],FILTER(PowerCounters,PowerCounters[Date]<=DATE(2017,3,29) && PowerCounters[Date]>=DATE(2017,3,28)))
Thanks,
Lydia Zhang - Anonymous9 years agoNot applicable
Any filtering you add to the report/page/visual should in theory... "just work". Is that not the case?
- dkushner9 years agoFrequent Visitor
It seems to me I don't explain the task correctly ))
Your formula “Total Delta := SUMX(VALUES(PowerCounters[CounterNumber]), [Delta by Aplus])”
Is calculating SUM of “Delta by Aplus” for all unique Counters in the Column, and now if I won’t to calculate SUM of “Delta by Aplus” not for all counters, I have to create a special column with already filtered date.
And I am wondering how to do it using DAX formulas )