Forum Discussion

MarvinConceição's avatar
6 years ago
Solved

Table with Percentage per item

Hi guys, I'm having a trouble creating a DAX to give me a percentage of acordim to a line value, I got my data like this: Product Exists A 1 A 0 A 1 A 1 A 0 B 0 B 0 ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    First calculate the number of "1"

     

    Number of 1=COUNTROWS(FILTER(Table;Table[Exist]=1))

    if you put in a visual with the product as rows you should have

    A 3
    B 2
    C 4

    Now the trick is to calculate how many rows you have, in total and that can easily done with a measure
    Number of Rows = COUNTROWS(Product)

    Again if you put both measures in a table

    A 2 5
    B 3 5
    C 4 5

     

    Now just make a third measure that does the percentage
    ----------------------

    Based on your question, I suggest you to take at least a basic course on how DAX works