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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Aggregating text values from rows

I have 3 tabels. 

Table 1 contains a series of Policy numers

Table 2 Each Policy has 1 or more line items, which represent a coverage. They are represented by a TypeNr

Table 3. Each coverage (TypeNr) is either a saving of risc.

 

What I need, is a column is table 1, which shows if the policy only have items of the type Saving, Risc og Both. Any help will be greatly appreciated

 

 

Torb_3-1699692490947.png

 

 

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.

It is for creating a new table.

 

Jihwan_Kim_0-1699694476800.png

 

Jihwan_Kim_1-1699694832461.png

 

Expected result new table =
VAR _t =
    SUMMARIZE ( Policy_Type, Policy[Policy], 'Type'[Type] )
VAR _condition =
    ADDCOLUMNS (
        _t,
        "@Coverage",
            IF (
                COUNTROWS ( FILTER ( _t, Policy[Policy] = EARLIER ( Policy[Policy] ) ) ) > 1,
                "Both",
                'Type'[Type]
            )
    )
RETURN
    SUMMARIZE ( _condition, Policy[Policy], [@Coverage] )

 

 


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.

It is for creating a new table.

 

Jihwan_Kim_0-1699694476800.png

 

Jihwan_Kim_1-1699694832461.png

 

Expected result new table =
VAR _t =
    SUMMARIZE ( Policy_Type, Policy[Policy], 'Type'[Type] )
VAR _condition =
    ADDCOLUMNS (
        _t,
        "@Coverage",
            IF (
                COUNTROWS ( FILTER ( _t, Policy[Policy] = EARLIER ( Policy[Policy] ) ) ) > 1,
                "Both",
                'Type'[Type]
            )
    )
RETURN
    SUMMARIZE ( _condition, Policy[Policy], [@Coverage] )

 

 


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Thank you - that was exactly what I needed

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.