Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Last month of pro Bono Rotation

I have the below measeure that is suppose to tell me the last month of pro bono rotation

 

LastProBonoRotationMonth =
VAR FeeEarnerName = MAX('WFE'[Fee Earner Name])
VAR ProBonoDates =
    CALCULATETABLE(
        VALUES('Work Period'[Calendar Month Of Year]),
        'WFE'[Practice Area Name] = "Pro Bono",
        'WFE'[Fee Earner Name] = FeeEarnerName
    )
VAR LastProBonoDate =
    MAXX(ProBonoDates, 'Work Period'[Calendar Month Of Year])
RETURN
LastProBonoDate
 
however, it is retrurning September as the last month and from the data below the last month should be February. 
 

Fee Earner

Nov 23

Dec 23

Jan 14

Feb 24

Mar 24

Apr 24

May 24

June

July

Person A

 

 

 

 

 

 

 

 

 

Pro Bono Rotation

157

157

159

157

 

 

 

 

 

Development Practice

 

 

 

 

112

41

55

68.7

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    lbendlin , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:

     

    Hi  Anonymous ,

    I created some data:

    Do you also have a date column associated with Work Period'[Calendar Month Of Year] in your WFE table?

    Here are the steps you can follow:

    1. Create measure.

    LastProBonoRotationMonth =
    VAR FeeEarnerName = MAX('WFE'[Fee Earner Name])
    VAR ProBonoDates =
    ADDCOLUMNS(
        FILTER(ALL('WFE'),
        'WFE'[Practice Area Name]="Pro Bono"&&'WFE'[Fee Earner Name]=MAX('WFE'[Fee Earner Name])&&[Value]<>BLANK()),
        "Test",
        MAXX(FILTER('Work Period','Work Period'[Calendar Month Of Year]=EARLIER('WFE'[Calendar Month Of Year])),'Work Period'[Calendar Month Of Year]))
    return
    MAXX(
        ProBonoDates,[Test])

    2. Result:

     

    If my explanations don't meet your expected results or don't understand your question, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

2 Replies

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

    Do not include sensitive information or anything not related to the issue or question.

    If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • Anonymous's avatar
    Anonymous
    Not applicable

    lbendlin , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:

     

    Hi  Anonymous ,

    I created some data:

    Do you also have a date column associated with Work Period'[Calendar Month Of Year] in your WFE table?

    Here are the steps you can follow:

    1. Create measure.

    LastProBonoRotationMonth =
    VAR FeeEarnerName = MAX('WFE'[Fee Earner Name])
    VAR ProBonoDates =
    ADDCOLUMNS(
        FILTER(ALL('WFE'),
        'WFE'[Practice Area Name]="Pro Bono"&&'WFE'[Fee Earner Name]=MAX('WFE'[Fee Earner Name])&&[Value]<>BLANK()),
        "Test",
        MAXX(FILTER('Work Period','Work Period'[Calendar Month Of Year]=EARLIER('WFE'[Calendar Month Of Year])),'Work Period'[Calendar Month Of Year]))
    return
    MAXX(
        ProBonoDates,[Test])

    2. Result:

     

    If my explanations don't meet your expected results or don't understand your question, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly