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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
iperezal
Frequent Visitor

Expand colum with lists

Hello,

 

I'm using PowerBI Desktop to display info from a Json file. Table created with imported data contains columns that are lists of objects. When I expand this tables with the Query Editor, this lists generate new duplicate rows where the only value wich is differen is rigth from this column. I have some dubtes about this:

 

- Is the info distorded because of expand lists?

- If, for example, I create a new colum in this dataset and then i whant to representate or compute a mesure, this info is distorded too?

- If affirmative, how can I do to correct this problem?

 

Thanks, regards

1 ACCEPTED SOLUTION

@iperezal

 

Sorry for the delay.


In JSON, an object("[{},{}]" part in your json file) is defined as: An object is an unordered set of name/value pairs. See JSON.org.

So the duplication in your case is by Cartesian product of the different objects. To get a proper data model,  one reasonable way is to duplicate the JSON query and break it into 3 tables.Capture.PNG

 

Then set one:many relationship, you report would show ok.

 

 

View solution in original post

9 REPLIES 9
iperezal
Frequent Visitor

any suggestion?

@iperezal

 

Sorry for the delay.


In JSON, an object("[{},{}]" part in your json file) is defined as: An object is an unordered set of name/value pairs. See JSON.org.

So the duplication in your case is by Cartesian product of the different objects. To get a proper data model,  one reasonable way is to duplicate the JSON query and break it into 3 tables.Capture.PNG

 

Then set one:many relationship, you report would show ok.

 

 

Greg_Deckler
Community Champion
Community Champion

My guess is that when you expand the list it is trying to display the entire list and so it duplicates all of the other columns so that each list item is in its own row. What you probably want to do is expand the list and then combine them all back so that the list column is something like:

 

item1,item2,item3

 

correct?

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

yes, correct

 

It's rigth this

@iperezal

 

I don't quite get your point. Say I have a json file as

 

Capture.PNG

 

And after "Transform->To Table" and "Expand column", I got the data as below.

 

Capture.PNG

 

The above table looks good for me, do you have any concern about this? If you do, could you show your problem in some snapshots?

yes, that table works for me too. The problem is when, for example body is an Json Array (Objects, strings... Any type)

@iperezal

 

Can you show some JSON sample in your case?

@Eric_Zhang This is an example to explain my dubtes:

json.pngtable.pngexpanded_table.pngexpanded_table2.pngexpanded_table3.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You can see: In the final table there are duplicated values from Json file

@Eric_Zhang

Look this graphic. My info is distorded.

"primero" value for "id" : 10230 should be 4+2 = 6 but powerBI has duplicated my info and I get 12

graphic.png

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors