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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Flammie
Helper I
Helper I

How to summarize data in multiple columns

I have 15 columns named [event1] through [event15]. In each column, the user selected an item from a dropdown (in the database). The list of items is exacly the same for every event. So, [event1] , [event4] and [event14] can  all have "approved" selected. I need to find all instances of "approved" (and all the other options one at a time) counted up. Here is my desired outcome:

 

Sum columns [event1], [event2],[event3]...etc... WHERE the event = "Approved"

Sum columns [event1], [event2],[event3]...etc... WHERE the event = "Waiting"

Sum columns [event1], [event2],[event3]...etc... WHERE the event = "Done"

 

With the result of:

Approved = 10 (accross all 15 columns)

Waiting = 15

Done = 12

 

 

 

 

1 ACCEPTED SOLUTION

Hi @Flammie ,

Maybe you can consider to use unpivot columns feature to merge these fields, then you can simply use formula to summary multiple attribute fields based on condition

Unpivot Data Using Excel Power Query

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @Flammie ,

Can you please provide some sample data with expected result to help us clarify your requirement?

How to Get Your Question Answered Quickly

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you. I added more information. I don't think I do very well explaining the set up. Basically, instead of being able to create instances of "phases" and being able to add as many phases as needed per document, the company has set up the database with 15 different "event" fields and lets the user fill in as many as are needed per document. It's fine I guess but it makes it really hard to sum up information like, "How many documents are in this particular phase at the moment?" because each "event" can be a different "phase". Does that help at all?

Hi @Flammie ,

Maybe you can consider to use unpivot columns feature to merge these fields, then you can simply use formula to summary multiple attribute fields based on condition

Unpivot Data Using Excel Power Query

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.


@v-shex-msft wrote:

Hi @Flammie ,

Maybe you can consider to use unpivot columns feature to merge these fields, then you can simply use formula to summary multiple attribute fields based on condition

Unpivot Data Using Excel Power Query

Regards,

Xiaoxin Sheng


I actually was able to do the Unpivot in Power Bi. It works like a charm! Thank you so much!

 

That is EXACTLY what I needed! Thank you so much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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