Forum Discussion

games1's avatar
games1
Frequent Visitor
8 years ago
Solved

How should i be doing this to develop the visualization?

I am trying to do a daily sale targetted pace report, i will create the table that is best to get this out   Filter  Month Date Week Employee  Manger    Ouput -    Every day of the month w...
  • v-xjiin-msft's avatar
    v-xjiin-msft
    8 years ago

    games1

     

    In your scenario, each of the columns from Account till Description can be the filter for your table. And you want to calculate the Cost1% or Cost2% based on these filters. Right?

     

    If so, you can refer to following method:

     

    You can use DAX expression like below to calculate the total count of table rows.

    Total Account = CALCULATE(COUNTROWS('Cost Percent'),ALLSELECTED('Cost Percent'))

    Also use expression like this to calculate the count of each Split values.

    CALCULATE(COUNTROWS('Cost Percent'),ALLSELECTED('Cost Percent'),VALUES('Cost Percent'[Split]))

    Then you can combine the two expression with Divide() function to calculae the Cost % like

    Cost % =
    DIVIDE (
        CALCULATE (
            COUNTROWS ( 'Cost Percent' ),
            ALLSELECTED ( 'Cost Percent' ),
            VALUES ( 'Cost Percent'[Split] )
        ),
        CALCULATE ( COUNTROWS ( 'Cost Percent' ), ALLSELECTED ( 'Cost Percent' ) )
    )

    The result show like this:

     

     

    Thanks,
    Xi Jin.

  • games1's avatar
    games1
    8 years ago

    v-xjiin-msft Thanks a lot for your insights, this is working perfectly as needed.