Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
harsin
Frequent Visitor

Create a measure or column to show if all 3 fees have been paid

I have a table of candidates who have been placed. A fee is charged once they have been in the role for 4 weeks, for 12 weeks and then at 22 weeks. 

For example:

CandidateDateweek
A01/02/234
B01/03/234
C11/03/234
D12/03/234
E25/03/234
A01/03/2312
C11/04/2312
D12/03/2312
A05/06/2322

 

I need to find a way to create a measure or column to show if all 3 fees (4,12,22) have been paid, such as the below:

CandidateDateweekAll 3 weeks?
A01/02/234No
B01/03/234No
C11/03/234No
D12/03/234No
E25/03/234No
A01/03/2312No
C11/04/2312No
D12/03/2312No
A05/06/2322Yes


My initial thought was to check if the candidate had a fee for all 3 week marks within a 22 week period but thought the way above would be best.

4 REPLIES 4
ThxAlot
Super User
Super User

Flag = 
COUNTROWS(
    WINDOW(
        1, ABS,
        0, REL,
        ALLSELECTED( PYMT[Candidate], PYMT[week] ),
        ORDERBY( PYMT[week] ),
        PARTITIONBY( PYMT[Candidate] )
    )
) = 3

ThxAlot_0-1702283177940.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please try something like below if it suits your requirement.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1702268799506.png

 

 

expected result CC =
VAR _t =
    SUMMARIZE (
        FILTER (
            Data,
            Data[Candidate] = EARLIER ( Data[Candidate] )
                && Data[Date] <= EARLIER ( Data[Date] )
        ),
        Data[week]
    )
VAR _conditionone = { 4 } IN _t
VAR _conditiontwo = { 12 } IN _t
VAR _conditionthree = { 22 } IN _t
RETURN
    IF ( _conditionone && _conditiontwo && _conditionthree, "Yes", "No" )

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Thank you Jihwan_Kim, I got the below error:

Function 'CONTAINSROW' does not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values. So I changed your code slightly:

expected result CC =

VAR _t =

    SUMMARIZE (

        FILTER (

            'WFA Revenue',

            'WFA Revenue'[PARTICIPANT_ID] = EARLIER ( 'WFA Revenue'[PARTICIPANT_ID] )

                && 'WFA Revenue'[PAYMENT_DATE] <= EARLIER ( 'WFA Revenue'[PAYMENT_DATE] )

        ),

        'WFA Revenue'[Outcome Week]

    )

VAR _conditionone = { "4" } IN _t

VAR _conditiontwo = { "12" } IN _t

VAR _conditionthree = { "22" } IN _t

RETURN

    IF ( _conditionone && _conditiontwo && _conditionthree, "Yes", "No" )

However all results are no, there should be some yes

Hi,

please share your sample pbix file's link, and then I can try to look into it.

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.