Forum Discussion
Quick Measures not working in table visual
Hi,
I am testing quick measures for running totals. There is an issue, when I use the running total in a table visual, so that it doesn'n sum at all.
test table:
Index Date Type Value
| 1 | 01.01.2019 00:00:00 | A | 100 |
| 2 | 03.01.2019 00:00:00 | B | 200 |
| 3 | 07.01.2019 00:00:00 | A | 300 |
| 4 | 02.02.2019 00:00:00 | B | 1040 |
| 5 | 02.02.2019 00:00:00 | B | 350 |
| 6 | 15.02.2019 00:00:00 | B | 230 |
| 7 | 05.03.2020 00:00:00 | A | 550 |
When I put all those columns into a table visual and add the quick measure running total:
hi, Anonymous
This relates to the row context and filter context in DAX,
https://www.sqlbi.com/articles/row-context-and-filter-context-in-dax/
https://docs.microsoft.com/en-us/dax/allselected-function-dax
If you use this measure
Running Total =CALCULATE(SUM('FactsTable'[Value]);FILTER(ALLSELECTED('FactsTable'[Index]);ISONORAFTER('FactsTable'[Index]; MAX('FactsTable'[Index]); DESC)))It only removes context filters for Index column.Now the visual should only incude Index attribute column. If there are other attribute column, it needs same.For exampleIn your case, for the same date and type, it will work.So you need put ALLSELECTED('FactsTable') instead of ALLSELECTED('FactsTable'[Index]).Best Regards,
Lin
1 Reply
- v-lili6-msft
Community Support
hi, Anonymous
This relates to the row context and filter context in DAX,
https://www.sqlbi.com/articles/row-context-and-filter-context-in-dax/
https://docs.microsoft.com/en-us/dax/allselected-function-dax
If you use this measure
Running Total =CALCULATE(SUM('FactsTable'[Value]);FILTER(ALLSELECTED('FactsTable'[Index]);ISONORAFTER('FactsTable'[Index]; MAX('FactsTable'[Index]); DESC)))It only removes context filters for Index column.Now the visual should only incude Index attribute column. If there are other attribute column, it needs same.For exampleIn your case, for the same date and type, it will work.So you need put ALLSELECTED('FactsTable') instead of ALLSELECTED('FactsTable'[Index]).Best Regards,
Lin