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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
zelda88
Regular Visitor

Help?

I have provided an example of what I'm hoping to do. Please do not hesitate to ask for clarification if the example is not clear. 

 

 

Name       Dependent       Form No.       Paid

Emil R.      Emily                 134                10 

Emil R.      Emily                 267                20

Emil R.      Emily                 372                5

Jon S.        Robert              573                19

Jon S.        Robert              213                38

Eve W.       Camilla            196                 63

Eve W.       Eve W.             196                 63

 

RESULT: 

Name       Dependent       Paid

Emil R.      Emily                 25  

Jon S.        Robert              19  

 

So, what I'm hoping to do is as follows:

If the number of forms per Dependent exceeds 1, I would like to obtain the total of "Paid" for all subsequent forms (not including the first) per dependent. We can find which forms come first in the series by inspecting the "Form No." wherein a larger form number indicates that a form comes later in the series. 

 

How do we automate this calculation? Any ideas would be very much appreciated!

1 ACCEPTED SOLUTION

@zelda88

 

This DAX calculated table might work as well

Sample file attached as well

 

From the Modelling tab>>New Table

 

New Table =
VAR Filter_Dependents =
    CALCULATETABLE (
        Grouped,
        FILTER (
            SUMMARIZE (
                Grouped,
                Grouped[Name],
                [Dependent],
                "Count", DISTINCTCOUNT ( Grouped[Form No.] )
            ),
            [Count] > 1
        )
    )
VAR RANK_Forms =
    FILTER (
        ADDCOLUMNS (
            Filter_Dependents,
            "RANK", RANKX (
                FILTER ( Filter_Dependents, [Name] = EARLIER ( [Name] ) ),
                [Form No.],
                ,
                ASC,
                DENSE
            )
        ),
        [RANK] > 1
    )
RETURN
    SUMMARIZE ( RANK_Forms, [Name], [Dependent], "Paid", SUM ( Grouped[Paid] ) )

View solution in original post

6 REPLIES 6
zelda88
Regular Visitor

I have provided an example of what I'm hoping to do. Please do not hesitate to ask for clarification if the example is not clear. 

 

 

Name       Dependent       Form No.       Paid

Emil R.      Emily                 134                10 

Emil R.      Emily                 267                20

Emil R.      Emily                 372                5

Jon S.        Robert              573                19

Jon S.        Robert              213                38

Eve W.       Camilla            196                 63

Eve W.       Eve W.             196                 63

 

RESULT: 

Name       Dependent       Paid

Emil R.      Emily                 25 

 

Jon S.        Robert              19  

 

So, what I'm hoping to do is as follows:

If the number of forms per Dependent exceeds 1, I would like to obtain the total of "Paid" for all subsequent forms (not including the first) per dependent. We can find which forms come first in the series by inspecting the "Form No." wherein a larger form number indicates that a form comes later in the series. 

 

How do we automate this calculation? Any ideas would be very much appreciated!

BKirsch12
Resolver II
Resolver II

This requires a few steps

 

1. Order by Form No. Ascending

2. Serialize the unique combination of Name and Dependent.

3. Filter out the first occurence on the index

4. Then do a group by on name and dependent while summing the paid column.

 

Example file has all the steps:

 

https://drive.google.com/file/d/152XDCLRmkex2xLqweagkwY-EXzHBi6E2/view?usp=sharing

 

This video shows how to do the serialization:

 

https://www.youtube.com/watch?time_continue=36&v=-3KFZaYImEY

 

Let me know if that helps.

 

 

 

 

@BKirsch12

Yes, I tried this and it worked! 🙂 Thank you for taking the time to help me out!

@zelda88

 

This DAX calculated table might work as well

Sample file attached as well

 

From the Modelling tab>>New Table

 

New Table =
VAR Filter_Dependents =
    CALCULATETABLE (
        Grouped,
        FILTER (
            SUMMARIZE (
                Grouped,
                Grouped[Name],
                [Dependent],
                "Count", DISTINCTCOUNT ( Grouped[Form No.] )
            ),
            [Count] > 1
        )
    )
VAR RANK_Forms =
    FILTER (
        ADDCOLUMNS (
            Filter_Dependents,
            "RANK", RANKX (
                FILTER ( Filter_Dependents, [Name] = EARLIER ( [Name] ) ),
                [Form No.],
                ,
                ASC,
                DENSE
            )
        ),
        [RANK] > 1
    )
RETURN
    SUMMARIZE ( RANK_Forms, [Name], [Dependent], "Paid", SUM ( Grouped[Paid] ) )

@Zubair_Muhammad

This is a very elegant solution! Thank you for your help! 🙂

I tried this and got the same results. Nice Solution.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.