Forum Discussion
Additional filter into measure
- 8 years ago
Hi dkushner,
From the description of your replay, you should create a calculated table first in the formula below to get the max value of SummAPlus for the each of CounterNumber by DataDateT.
Table = SUMMARIZE ( PowerCountersPreviousDay, PowerCountersPreviousDay[DataDateT], PowerCountersPreviousDay[CounterNumber], "Sumsingle", MAX ( 'PowerCountersPreviousDay'[SummAPlus] ) )Then, you could the measure :
Bussiness Unit = VAR count1sum = CALCULATE ( SUM ( 'Table'[Sumsingle] ), FILTER ( ALL ( 'Table'[CounterNumber] ), 'Table'[CounterNumber] = 1 ) ) VAR count139sum = CALCULATE ( SUM ( 'Table'[Sumsingle] ), FILTER ( ALL ( 'Table'[CounterNumber] ), 'Table'[CounterNumber] = 139 ) ) VAR count149sum = CALCULATE ( SUM ( 'Table'[Sumsingle] ), FILTER ( ALL ( 'Table'[CounterNumber] ), 'Table'[CounterNumber] = 149 ) ) RETURN count139sum + count1sum - count149sumThis picture of the result is below:
For more details, you could refer to this pbix file.
Hope it can help you!
Best Regards,
Cherry
Hi dkushner,
From the details you provide, if I understand your requirement correctly, you could use Data Hierarchy to get the Business Units of Year, Month or Day. You could create the measure :
Business Units = var count1sum =CALCULATE(SUM(PowerCountersPreviousDay[SummAPlus]),FILTER(ALL(PowerCountersPreviousDay[CounterNumber]),PowerCountersPreviousDay[CounterNumber]=1)) var count139sum = CALCULATE(SUM(PowerCountersPreviousDay[SummAPlus]),FILTER(ALL(PowerCountersPreviousDay[CounterNumber]),PowerCountersPreviousDay[CounterNumber]=139) ) var count149sum = CALCULATE(SUM(PowerCountersPreviousDay[SummAPlus]),FILTER(ALL(PowerCountersPreviousDay[CounterNumber]),PowerCountersPreviousDay[CounterNumber]=149)) RETURN count139sum+count1sum-count149sum
You could refer to this picture below:
Reference for pbix file
Hope it can help you!
Best Regards,
Cherry
Hi!
I am really sorry, but it isn't so easy )
as I mentioned, I have repeated rows in the same period, and your formula summarized all repeating values.
but I have to select only one. For example for the CounterNumber = 1,
I have 3 rows , with the same indications in the 1 day, I need to use in calculation only 1
ID |
Best regards, Dmitry