Forum Discussion
Accumulate values by several dimensions
Hello data warriors!
I've been trying to solve a problem that is using a measure that accumulates revenue based on month, day and year. Basically I want to use it in a bar chart with drilldowns, each drilldown will change the dimension, so I intend to make the measure adapt to the dimension shown.
This chart below already shows a measure accumulating only by month, I want transform it into these three dimensions I mentioned.
So I tried using this expression:
But it didn't bring right values. Can someone give me a guidance? Sorry if I weren't clear enough.
- Anonymous7 years ago
Hey TeigeGao ,
Sorry, what I tried to meant is that the bar chart when the user change the levels of drilldown, it changes based on the dimensions dragged in the object(which is: month, year, day).
I manage to solve that using another measure that makes a decision structure, for instance:
Month accumulative measure:CALCULATE([06M - Revenue];FILTER(CALCULATETABLE(SUMMARIZE('Cupom'; 'Cupom'[Month Number; 'Cupom'[Month Name]);ALLSELECTED('Cupom'));ISONORAFTER('Cupom'[Month Number]; MAX('Cupom'[Month Number]); DESC;'Cupom'[Month Name]; MAX('Cupom'[Month Name]); DESC))
Year Accumulative Measure:Day Accumalitive Measure:CALCULATE([06M - Revenue];FILTER(ALLSELECTED('Cupom'[Year]);ISONORAFTER('Cupom'[Year]; MAX('Cupom'[Year]); DESC)))CALCULATE([06M - Revenue];FILTER(ALLSELECTED('Cupom'[Day]);ISONORAFTER('Cupom'[Day]; MAX('Cupom'[Day]); DESC)))
So I created this last measure that verifies if inside the drilldown each one is being filtered, so it accumulates based on what the measure calculates:
Accumulative Activation:F(ISFILTERED(Cupom[Month Name); [Month Accumulative Measure];IF(ISFILTERED(Cupom[Year]);[Year Accumulative Measure];IF(ISFILTERED(Cupom[Day]); [Day Accumulative Measure];0)))
Hope you understand.
2 Replies
- TeigeGao
Solution Sage
Hi Anonymous ,
Could you please share some sample data and expected result to us for analysis? It's sorry that I can't understand your requirement well.
As you mentioned above, "each drilldown will change the dimension", the filter cannot change the dimension, it can only filter data in this dimension.
Best Regards,
Teige
- AnonymousNot applicable
Hey TeigeGao ,
Sorry, what I tried to meant is that the bar chart when the user change the levels of drilldown, it changes based on the dimensions dragged in the object(which is: month, year, day).
I manage to solve that using another measure that makes a decision structure, for instance:
Month accumulative measure:CALCULATE([06M - Revenue];FILTER(CALCULATETABLE(SUMMARIZE('Cupom'; 'Cupom'[Month Number; 'Cupom'[Month Name]);ALLSELECTED('Cupom'));ISONORAFTER('Cupom'[Month Number]; MAX('Cupom'[Month Number]); DESC;'Cupom'[Month Name]; MAX('Cupom'[Month Name]); DESC))
Year Accumulative Measure:Day Accumalitive Measure:CALCULATE([06M - Revenue];FILTER(ALLSELECTED('Cupom'[Year]);ISONORAFTER('Cupom'[Year]; MAX('Cupom'[Year]); DESC)))CALCULATE([06M - Revenue];FILTER(ALLSELECTED('Cupom'[Day]);ISONORAFTER('Cupom'[Day]; MAX('Cupom'[Day]); DESC)))
So I created this last measure that verifies if inside the drilldown each one is being filtered, so it accumulates based on what the measure calculates:
Accumulative Activation:F(ISFILTERED(Cupom[Month Name); [Month Accumulative Measure];IF(ISFILTERED(Cupom[Year]);[Year Accumulative Measure];IF(ISFILTERED(Cupom[Day]); [Day Accumulative Measure];0)))
Hope you understand.