Forum Discussion

hosea_chumba's avatar
hosea_chumba
Helper I
4 years ago
Solved

Dax Equations

Hello fellow community,

Kindly help to solve the below problem;

Consider the tables below, they are implementation tracking reports for 3 quarters in FY 22.

I would like to achieve the following:

  1. Create a measure called "Weighted Implementation" in percentage in each quarter i.e. considering the following:
    • Each issue with "Closed" [Implementation Status] = 1 (i.e. the weight = Number of closed Issues * 1), "Partially Implemented" [Implementation Status] =0.5 (i.e. the weight =Number of Partially Implemented Issues * 0.5), "Open" [Implementation Status] = 0 (i.e. the weight = Number of Open Issues * 0)
    • To compute the Weighted Implemetation Percentage, divide:  Numerator= (Number of closed Issues *1 + No of Partially Implemented Issues * 0.5), Denominator = Total number of Issues i.e. count of the Unique references without any weighting, e.g. Total number of issues in FY22 Q1 =4, FY22Q3=6
  2. A line and clustered column chart showing the [Weighted Implemetation] percentage as the secondary Y axis line chart for FY22Q3 and the immediate previous 2 quarters, X axis indicating the [Office] and Y axis indicating Number of "Open Issues".
  3. Clustered column chart showing the trend of the [Weighted Implemetation] percentage for the 3 quarters in FY22 for the various [Office]s.
  4. Note the below facts:
    • The [Implementation Status] changes over time (from Quarter to quarter) as reflected in the tables below for some of  the issues being tracked.
    • New Issues are added over time (Ideally the old issues can be dropped when they are too old depending on policy, in this example lets assume the issues are yet to be dropped)
    • @SpartaBI 
FY22Q1 Report   
Unique Issue Tracking Ref.Quarter the Issue was raisedImplementation StatusOffice
123FY21Q1OpenArmenia
124FY21Q3ClosedSri Lanka
125FY22Q1Partially ImplementedSenegal
126FY22Q2OpenEcuardo
    
    
FY22Q2 Report   
Unique Issue Tracking Ref.Quarter the Issue was raisedImplementation StatusOffice
123FY21Q1OpenArmenia
124FY21Q3ClosedSri Lanka
125FY22Q1Partially ImplementedSenegal
126FY22Q2OpenEcuardo
127FY22Q3OpenArmenia
    
    
FY22Q3 Report   
Unique Issue Tracking Ref.Quarter the Issue was raisedImplementation StatusOffice
123FY21Q1ClosedArmenia
124FY21Q3ClosedSri Lanka
125FY22Q1ClosedSenegal
126FY22Q2OpenEcuardo
127FY22Q3OpenArmenia
128FY22Q4Partially ImplemetedEcuardo
  • Hi hosea_chumba 
    Please refer to the sample file with the proposed solution https://www.dropbox.com/t/0yKTjmbzDXqrfUv6

     

    Weighted Implementation = 
    DIVIDE (
        SUMX (
            SUMMARIZE ( 
                'Compiled Report', 
                'Compiled Report'[Unique Issue Tracking Ref.], 
                'Compiled Report'[Implementation Status] 
            ),
            CALCULATE ( 
                SELECTEDVALUE ( Weightages[Weight] ), 
                CROSSFILTER ( 'Compiled Report'[Implementation Status], Weightages[Status], Both ) 
            )
        ),
        DISTINCTCOUNT ( 'Compiled Report'[Unique Issue Tracking Ref.] )
    )

     

8 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi hosea_chumba 
    Please refer to the sample file with the proposed solution https://www.dropbox.com/t/0yKTjmbzDXqrfUv6

     

    Weighted Implementation = 
    DIVIDE (
        SUMX (
            SUMMARIZE ( 
                'Compiled Report', 
                'Compiled Report'[Unique Issue Tracking Ref.], 
                'Compiled Report'[Implementation Status] 
            ),
            CALCULATE ( 
                SELECTEDVALUE ( Weightages[Weight] ), 
                CROSSFILTER ( 'Compiled Report'[Implementation Status], Weightages[Status], Both ) 
            )
        ),
        DISTINCTCOUNT ( 'Compiled Report'[Unique Issue Tracking Ref.] )
    )

     

  • Thanks so much tamerj1 , did you use a formula to add the  [Report Quarter] column for the respective quarters taking into consideration that it is large data. 

    • tamerj1's avatar
      tamerj1
      Community Champion

      hosea_chumba 
       Actually yes. I assumed that this is the case of your model. Otherwise why would you keep them in separate tables and add a new table every new quarter? I know saving one column is a good idea but sometimes you need to do the math.