Forum Discussion

margeausoboti's avatar
margeausoboti
Advocate I
8 years ago
Solved

DAX help

Hello, I am working with a very small data set (see image) and I am trying to find percentages based on filter criteria using DAX.   1. My first equation was to find the total count of each animal,...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    8 years ago

    Hi margeausoboti,

    You want to create a calculated column to get the percentage? If it is, please create calculated columns using the fomulas, and check if it works fine.

    each type percentage =
    CALCULATE ( SUM ( Table[Count] ), ALLEXCEPT ( Table, Table[tipo] ) )
        / SUMX ( ALL ( Table ), Table[Count] )
    
    each Animal percentage =
    CALCULATE ( SUM ( Table[Count] ), ALLEXCEPT ( Table, Table[Animal] ) )
        / SUMX ( ALL ( Table ), Table[Count] )
    
    each Color percentage =
    CALCULATE ( SUM ( Table[Count] ), ALLEXCEPT ( Table, Table[Color] ) )
        / SUMX ( ALL ( Table ), Table[Count] )
    

    Don't hesitate to ask if you have any other issues.

    Best Regards,
    Angelia