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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors