Forum Discussion

avo_om2134's avatar
avo_om2134
Frequent Visitor
2 years ago
Solved

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?

 

2022red
2022red
2022red
2022blue
2023red
2023red
2023blue
2023blue

 

desired outcome:
2022 Red: 3; 2022 Blue: 1
2023 Red: 2; Blue: 2

 

  • Anonymous's avatar
    Anonymous
    2 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

  • Anonymous's avatar
    Anonymous
    Not 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

     

  • 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))