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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
zero99
Frequent Visitor

Multiple Unpivot Issues on Charts

Hi All, 

 

I have the two sets of 4 columns that I seperately unpivotted to create 2 charts. The original raw data looks like the following:

 

zero99_0-1697971550400.png

 

I then unpivot both seperately to create these columns:

zero99_1-1697971629804.png

 

The problem is doing the 2nd Unpivot inflated the figure in the 1st Unpivot chart (see below):

 

This is the result of 1st Unpivot BEFORE I did 2nd Unpivot.

zero99_2-1697971805542.png

This is the result AFTER I did 2nd (another) unpivot; The figure in the chart inflated significantly AND the 'Brand attribute' filter doesnt work on the Price Line chart.

zero99_3-1697971894497.png

 

 

For creation of both charts, I have been enquiring the Power BI community. Links for this issue:

1. Raw Data & Latest Pbix: here 

2. Brand Pie Chart Thread: here

3. Pricing Line Chart thread: here

 

4 REPLIES 4
zero99
Frequent Visitor

Hi @danextian 

 

Here is the Raw Data & Latest Pbix: here 

 

1. The End Goal

The end goal is to create a Likelihood pie chart and Pricing (Cheapest to Most Expensive) Line chart.

 

zero99_0-1698029362907.png

In the pbix, I have managed to achieve this (but there are some issue with number/figure shown) in the charts. I will explain in the section 3 below.

 

2. My approach to the goal

BEFORE PROCESSING

This is how the raw data looks like:

zero99_1-1698029538814.png

 

Likelihood_ columns will be used to create 'likelihood by brand' pie chart and Brand_Attribute filter

Price_ columns willl be used to create the pricing line chart.

 

AFTER PROCESSING

I have done the following: to the data:

1a. Unpivot Likelihood_X columns

1b. Create likelihood pie chart and brand attribute filter

2a. Do another unpivot on Price_X columns

2b. Create Price Line chart

 

zero99_2-1698029837484.png

 

3. Issues to Section 2 Approach result

However, there are some issues with my approach above:

   1. The figure in pie chart after the 2nd Unpivot (after step 2a and 2b are done) has increased significantly and not accurate.

 

BEFORE

zero99_3-1698030077638.png

 

AFTER

zero99_4-1698030121004.png

As shown above, the extremely likely figure jump from 156 to 396 and somewhat likely has jumped from 86 to 178. 

 

2. The brand filter doesnt work on the line chart. The figure stays the same. 

 

I have previously asked help for each chart creation on Power BI community. 

 

a. Brand Pie Chart Thread: here

b. Pricing Line Chart thread: here

 

Please let me know if anything need to be clarified. 

 

Thank you in advance

 

Hi @zero99 ,

 

My apologies if I didn't make myself clear. The charts aside, if you were to manually transform  your data (id 1) in Excel how would it look after doing so?  Which cell goes to which column/row?  Please see an example below

 

Before

danextian_3-1698053721614.png

After

danextian_4-1698053729495.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian 

 

I am a total newbie to Power BI so I am not even sure what final data structure should look like for my charts and filter to work.

 

I have transformed my table from BEFORE to AFTER (but the AFTER structure failed to delivered my goal charts in section 2 as some issues in section 3 arised).

 

So I am looking for advice why it didnt fully work for my charts (the issues mentioned in section 3 above); whether it need further processing or entirely need to be structured differently.

 

BEFORE (RAW DATA)

zero99_0-1698063961423.png

 

AFTER (CURRENT STATE)

Processing done so far:

- Unpivot Blue and Pink  to brand_attribute and brand_value (1st Pivot)

- Unpivot Yellow and Green to Price_attribute and Price_Value (2nd Pivot)

zero99_3-1698064331021.png

 

 

POTENTIAL ISSUES WITH DOING 2 SEPERATE UNPIVOT PROCESSES

I have attached the checking excel data from RAW TO 1st unpivot TO 2nd unpivot here

 

The file name is Raw Data Transformation.xlsx

 

1. Repeated Brand attribute after 2nd unpivot

In the file, I can see that as a result of 2nd Unpivot, the Likelihood_honda for case id 1 has been repeated twice. This might be why my pie chart figure increased significantly.

zero99_5-1698065287204.png

 

zero99_6-1698065321575.png

 

Should I group by the brand_attribite field or what do you reckon should be the appropriate solution?

 

2. Brand_attribute slicer didnt work on line chart

Theoritically, by selecting the brand_attribute slicer, the figure in the pricing line chat should changed but that is not the case.

 

zero99_7-1698065825354.png

Is it because the brand_x fields  and price_X fields are seperated as a result from 2 different unpivot processes? If so, how should we structure the data so we can filter price chart using brand_attribute slicer? Should I unpivot all the column together as a unit? 

 

Overall, how do you think my 2nd unpivot result should look like for my chart to work properly in Power BI? and how can I achieve so using DAX or Power BI processing?

 

 

Thank you in advance for your patience and help 🙂. It would be helpful and appreciated if anyone can provide me with a working pbix and some instruction how to do it.

danextian
Super User
Super User

Hi @zero99 ,

 

I would suggest you posted your sample result. For example for id 1, how do you want your data to look after the transformations? That way the community will have a better idea of what you're trying to achieve.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors