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
ymc
New Member

How to create a summary table or matrix for different value combination from the same column

My database has records as shown below. 

 

LocationEventOwnerHour
XE1A2
XE2B3
XE3C4
YE2D5
YE3E6
YE4F7
ZE1G8
ZE3H9
ZE5I10

 

I need to find out which location has both event E1 and E3, and need to generate a summary table as shown below. 

 

LocationEventOwnerHourEventOwnerHour
XE1A2E3C4
ZE1G8E3H9

 

How to do that in Power BI ? 

4 REPLIES 4
ymc
New Member

Thanks for the quick response and solution. Is there another way to generate such summary table by using visulal only? I am very new to PowerBI, not sure how to impletement those codes actually. 

Hi @ymc ,

 

Please try:

First create these measures:

Event_1 = CALCULATE(MAX('Table'[Event]),FILTER('Table',[Event]="E1"))

Hour_1 = CALCULATE(SUM('Table'[Hour]),FILTER('Table',[Event]="E1")) 

Owner_1 = CALCULATE(MAX('Table'[Owner]),FILTER('Table',[Event]="E1"))

Event_3 = IF([Event_1]<>BLANK(),CALCULATE(MAX('Table'[Event]),FILTER('Table',[Event]="E3")))

Hour_3 = IF([Event_1]<>BLANK(),CALCULATE(SUM('Table'[Hour]),FILTER('Table',[Event]="E3")))

Owner_3 = IF([Event_1]<>BLANK(),CALCULATE(MAX('Table'[Owner]),FILTER('Table',[Event]="E3")))

You can copy and paste them here:

vjianbolimsft_0-1685496229671.png

Then put them and 'Location' into the table visual:

vjianbolimsft_1-1685496284418.png

Final output:

vjianbolimsft_2-1685496314092.png

Best Regards,

Jianbo Li

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

Hi, Thanks for the detailed instruction for the solution. It works as expected however pretty time consuming.

 

Meanwhile after some searching, I found a trick by dupicating the data source table, then linking them together by location. Now I can quickly use visual filters to generate a table I need. 

 

Thanks again for your help anyway. 

 

ymc_0-1685641956550.png

 

v-jianboli-msft
Community Support
Community Support

Hi @ymc ,

 

Please try:

summary table =
VAR _a =
    FILTER ( 'Table', 'Table'[Event] IN { "E1", "E3" } )
VAR _b =
    FILTER (
        _a,
        COUNTROWS ( FILTER ( _a, [Location] = EARLIER ( 'Table'[Location] ) ) ) = 2
    )
RETURN
    SUMMARIZE (
        _b,
        'Table'[Location],
        "Event_1", "E1",
        "Owner_1", CALCULATE ( MAX ( 'Table'[Owner] ), FILTER ( 'Table', [Event] = "E1" ) ),
        "Hour_1", CALCULATE ( SUM ( 'Table'[Hour] ), FILTER ( 'Table', [Event] = "E1" ) ),
        "Event_3", "E3",
        "Owner_3", CALCULATE ( MAX ( 'Table'[Owner] ), FILTER ( 'Table', [Event] = "E3" ) ),
        "Hour_3", CALCULATE ( SUM ( 'Table'[Hour] ), FILTER ( 'Table', [Event] = "E3" ) )
    )

Final output:

vjianbolimsft_0-1685326678129.png

Best Regards,

Jianbo Li

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

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.

Top Solution Authors