Forum Discussion
How to Filter multiple columns to count value?
Hi - I am fairly new to PBI and trying to understand how to filter / count value.
I'd ultimately like to filter the year and count or filter + count the number of red vs blue.
Am I able to write something in DAX to produce this?
| 2022 | red |
| 2022 | red |
| 2022 | red |
| 2022 | blue |
| 2023 | red |
| 2023 | red |
| 2023 | blue |
| 2023 | blue |
desired outcome:
2022 Red: 3; 2022 Blue: 1
2023 Red: 2; Blue: 2
- Anonymous2 years ago
Hi avo_om2134 ,
If I understand correctly, the issue is that you want to filter the year and count the red and blue. To solve the issue, you can follow these steps:
1.Create a simple table.
2.Select the table visual onto the report canvas. Move the Data and color to the Columns.
3.Move the color to the Columns and select the count.
4.You can see the desired outcome.
Looking forward to your reply.
Best Regards,
Wisdom Wu
2 Replies
- AnonymousNot applicable
Hi avo_om2134 ,
If I understand correctly, the issue is that you want to filter the year and count the red and blue. To solve the issue, you can follow these steps:
1.Create a simple table.
2.Select the table visual onto the report canvas. Move the Data and color to the Columns.
3.Move the color to the Columns and select the count.
4.You can see the desired outcome.
Looking forward to your reply.
Best Regards,
Wisdom Wu
- Kavin_Mano620New Member
Hi avo_om2134
if you can use dax functions to grouping and count values
Step 1 : Click Data View your table (year and colour table ) and then the ribbon will show the table tools
Step 2: Create new Table
step 3:
use the code -
summarytable = SUMMARIZE(Yourtable,Yourtable[year],Yourtable[colour], "Count", COUNTROWS(Yourtable))