Forum Discussion
Filter by column in underlying data
- 4 years ago
td48260 not sure what you mean using type on the slicer will throw the count off
just use type and year as a slicer and a simple measure
Count = COUNTROWS ( Table )or maybe I didn't understand your question, explain it with sample data if that is the case.
✨ Follow us on LinkedIn and to our YouTube channel
Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
Sorry, I didn't explain it well.
| ID | Year | Type |
| 1 | 2014 | A |
| 2 | 2015 | B |
| 3 | 2015 | C |
| 4 | 2016 | A |
| 5 | 2016 | B |
| 6 | 2016 | C |
I want a column chart where the Axis column is Year and the Values column is a count of the rows. There should be filters or slicers for Year and Type. In the example above, if all Years and all Types were selected the chart should reflect this data:
Year Value (count)
2014 1
2015 2
2016 3
If only A is checked in the filter/slicer, then this should be the data:
Year Value (count)
2014 1
2016 1
The order of operations should be
1. Filter table rows by Year and Type filter/slicer values
2. Group the results by Year
3. Calculate Count for each Year
I tried creating measures for
COUNTROWS(Table)
and
calculate(count([value]),table[year]== selectedvalue(table[year]) && table[Type] == selectedvalue(table[type])
In both cases I got syntax errors which I've been unable to resolve.
Thanks for your help.