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 when selected sales till date compared vs the target and gap.... update the revised targets per day for the remaining days considering the overall target

 

 

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

4 Replies

  • games1

     

    Your shared information is too simple for us to understand your requirement. Please kindly share us more detailed information like some sample data and your desired result.

     

    By the way, it seems like that you want to create some kind of report which is used to compare current part of data vs the target and display the gap and update the revised target. Right?

     

    Please refer to following sample report, see if it helps you:

    https://community.powerbi.com/t5/Data-Stories-Gallery/Team-Performance-vs-Target-refreshed-daily/m-p/304850

     

    Thanks,
    Xi Jin.

    • games1's avatar
      games1
      Frequent Visitor

      Apologies, I am trying differrnet options and did not want to share the official data was the reason for having a week question.

       

      Here is the real issue that i am facing or need help

       

      On the table below, starting from Account till Descritpion (I will keep appending data) and i would need to use them as filter on the visualization.

       

      I want to calculate Cost 1% and Cost 2 % - Matching all the senarious or filter that i would select on the visual...

       

       

      AccountFiscalSenarioJob typeRegionGeoLocationQuadrantScenario TypeScenario Type 1DescriptionSplitH1H2Y
      1FY 18BudgetANAUSTPRR1DDDSales100100100
      1FY 18BudgetANAUSTPRR1DDDCost 1505050
      1FY 18BudgetANAUSTPRR1DDDCost 2202020
      1FY 18ActualANAUSTPRR1DDDSales100100100
      1FY 18ActualANAUSTPRR1DDDCost 1505050
      1FY 18ActualANAUSTPRR1DDDCost 2202020
      2FY 18BudgetANAUSTPRR1DDDSales100100100
      2FY 18BudgetANAUSTPRR1DDDCost 1505050
      2FY 18BudgetANAUSTPRR1DDDCost 2202020
      2FY 18ActualANAUSTPRR1DDDSales100100100
      2FY 18ActualANAUSTPRR1DDDCost 1505050
      2FY 18ActualANAUSTPRR1DDDCost 2202020
      • v-xjiin-msft's avatar
        v-xjiin-msft
        Solution Sage

        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.