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
wesleyvieira
Helper I
Helper I

Sum unpivoted table by period

Hello everyone! Need some help with unpivot table.

 

I have a table with several columns and need to put the columns in rows, so I unpivoted the selected columns and now when I use a filter of months the total sum in the visual stay the same. See the pictures attached.

 

Picture 1.JPGPicture 2.JPG

 

 

 

 

 

 

 

 

 

Any idea to fix it?

 

Thanks in advance.

1 ACCEPTED SOLUTION

@wesleyvieira

 

I agree with @CahabaData. Since your data in visual doesn't filter the data with the selection in slicer at all, it means the data can be sliced on time period level. You need to check your time period colum in your dataset (unpivoted table). Make sure you have multiple records for each "CUSTOS DE SERVIR" in different periods so that it will aggregate on same "CUSTOS DE SERVIR".

 

Did you direct put that time period column into Slicer? Or you drag a field from another Date table? In that case, you may check the defined relationship between these two tables on datekey.

 

Regards,

View solution in original post

11 REPLIES 11
Vvelarde
Community Champion
Community Champion

@wesleyvieira

 

All your values are the same in both images not only the total

 




Lima - Peru

Yep @Vvelarde all the values should change, not only the total.

BhaveshPatel
Community Champion
Community Champion

Can you please post the sample data set or the steps you are following for the unpivoting in Query mode.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

@BhaveshPatel I selected the table in my left and in the midle of the page, showed all the columns of the table, then I selected the columns I need to unpivot, then in Transform ribbon I choose "Transform columns in rows" (I don't know if it is the correct name, because my Power BI is in Brazilan Portuguese).

 

Hope I've been understandable. Smiley Very Happy

Hi There,

 

Capture.PNG

 

As shown in the screenshot, you should use unpivot coumns under the transform tab. Not sure what is it called in Brazillian Portuguse Language but It must be postioned at the same location. 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Hello @BhaveshPatel.

 

I did it exactly this way! And after doing this procedure and using the visual Table the values do not change when I select different periods.

If the data does not change in the visual when you filter/slice - that would imply that the time periods are not part of the table data.  In your original post I do not see the time periods included as that table data either (although they do not have to display) but it raises the question as to whether this could be the issue.

www.CahabaData.com

Hello @CahabaData.

 

The periods are part of table data and don't need to be shown in Visual Table. I only need of the periods at the filter to show the sum of values of the periods selected.

@wesleyvieira

 

I agree with @CahabaData. Since your data in visual doesn't filter the data with the selection in slicer at all, it means the data can be sliced on time period level. You need to check your time period colum in your dataset (unpivoted table). Make sure you have multiple records for each "CUSTOS DE SERVIR" in different periods so that it will aggregate on same "CUSTOS DE SERVIR".

 

Did you direct put that time period column into Slicer? Or you drag a field from another Date table? In that case, you may check the defined relationship between these two tables on datekey.

 

Regards,

Hello there!

 

I checked and realized I was taking the period of another table that I use in others visual in the same page. When I took the field period of the same table it worked!

 

 

Thank you guys for your time!

I can only suggest some sort of sanity check.  Perhaps on a temporary new page in your report make a simple table visual including the date field, and then add your slicer.....   just to check behavior.  It would only take a minute.

 

 

www.CahabaData.com

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.