cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sharmon9000 Regular Visitor
Regular Visitor

Filter Weekly Totals by Company when both weekly totals are returned in 1 row

I was trying to figure out a way to filter by company when the weekly totals are returned on 1 row by week.

 

Example of returned row from database:

| WeekEnding  |   Company1   |  Company2  |
  2019-07-27       2500           3500
  2019-07-20       2200           3350
  2019-07-13       2600           3450

It was easy to combine the totals by week using a measure and SUM to combine both totals. But is it possible to have a filter where the TOTAL will be updated depending on if Company1 or Company2 or Both is selected?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filter Weekly Totals by Company when both weekly totals are returned in 1 row

@sharmon9000 - When more than one column are essentially the same data, it is best to "Unpivot" the columns. The easiest way to unpivot columns is in Power Query. Click "Edit Queries" to open the Power Query Editor, and then do the following:

1. Select Transform tab.

2. Select "WeekEnding" column.

3. Click the arrow next to"Unpivot Columns". 

4. Click "Unpivot Other Columns".

Unpivot.PNG

I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.
Nathan Peterson
1 REPLY 1
Super User
Super User

Re: Filter Weekly Totals by Company when both weekly totals are returned in 1 row

@sharmon9000 - When more than one column are essentially the same data, it is best to "Unpivot" the columns. The easiest way to unpivot columns is in Power Query. Click "Edit Queries" to open the Power Query Editor, and then do the following:

1. Select Transform tab.

2. Select "WeekEnding" column.

3. Click the arrow next to"Unpivot Columns". 

4. Click "Unpivot Other Columns".

Unpivot.PNG

I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.
Nathan Peterson

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 62 members 1,230 guests
Please welcome our newest community members: