Forum Discussion

NithinBN's avatar
NithinBN
Helper II
5 years ago
Solved

Text based filtering.

Hello All,

I have a table like this,

 

IndexProductValue
1BikeGreen
2BikeYellow
3BikeGreen
4BikeGreen
5BikeRed
6ClothingRed
7ClothingGreen
8ClothingRed
9ClothingYellow
10ClothingRed
11AccessoriesGreen
12AccessoriesRed
13AccessoriesGreen
14AccessoriesYellow
15AccessoriesGreen

 

I want to create a measure which count all the Green for product "Bike".

 

At last I want to have a bar chart, where axis is Product and value is Divide("Number of Green"/("Number of Yellow"+"Number of Red"))

 

Thanks in advance. 

 

 

  • NithinBN 

    Can you check this measure:

    Measure = 
    VAR Green = 
    CALCULATE(
        COUNTROWS(Table1),
        Table1[Value]= "Green"
    )
    VAR YellowRed = 
    CALCULATE(
        COUNTROWS(Table1),
        Table1[Value] = "Yellow" || Table1[Value] = "Red"
    )
    RETURN
    DIVIDE(
        Green,
        YellowRed
    )
    

     

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

3 Replies

  • NithinBN 

    Can you check this measure:

    Measure = 
    VAR Green = 
    CALCULATE(
        COUNTROWS(Table1),
        Table1[Value]= "Green"
    )
    VAR YellowRed = 
    CALCULATE(
        COUNTROWS(Table1),
        Table1[Value] = "Yellow" || Table1[Value] = "Red"
    )
    RETURN
    DIVIDE(
        Green,
        YellowRed
    )
    

     

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

      • Fowmy's avatar
        Fowmy
        Super User

        NithinBN 

        In a bar or column chart, keep the Product on the Axis and Measure on the Value



        ________________________

        If my answer was helpful, please consider Accept it as the solution to help the other members find it

        Click on the Thumbs-Up icon if you like this reply 🙂

        YouTube  LinkedIn