Displaying All Rows in Power BI Python Visuals

Answer Correct answer: C — Add a unique field to each row to ensure Power BI treats every row as distinct and displays all data without grouping.

You have a Fabric tenant that contains a Microsoft Power BI report named Report1. Report1 includes a Python visual. Data displayed by the visual is grouped automatically and duplicate rows are NOT displayed. You need all rows to appear in the visual. What should you do?

  1. Reference the columns in the Python code by index.
  2. Modify the Sort Column By property for all columns.
  3. Add a unique field to each row. Correct Answer
  4. Modify the Summarize By property for all columns.

Community Votes

C
53%
A
27%
D
20%

53% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The question tests the specific workaround for Power BI's default aggregation behavior in Python visuals: adding an index field to make rows distinct.

This page explains how to prevent automatic grouping in Power BI Python visuals by adding a unique identifier field, ensuring all rows including duplicates are displayed.

Candidates often choose Option A (referencing columns by index), confusing Pandas coding syntax with the dataset preparation requirement described in Microsoft documentation.

Community Discussion (45 comments)

TashaP 👍 64
A - often the Microsoft learn pages give you the exact answer: Under tips on the link I posted: In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping. https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals There are always multiple approaches in application but if you do the MS exam give the MS answer.
Fermd 👍 13 Selected: D
The right answer is D: By setting the "Summarize By" property to "None" for all columns, you disable automatic aggregation and ensure all rows, including duplicates, are displayed in the Python visual.
NRezgui 👍 1 Selected: C
Add a unique field to each row.
MultiCloudIronMan 👍 1 Selected: D
Modify the Summarize By property for all columns: By default, Power BI may summarize data in visuals, which can lead to grouping and aggregation of rows. Modifying the "Summarize By" property for all columns to "Do Not Summarize" will prevent this automatic grouping and ensure that all rows, including duplicates, are displayed in the visual.
Sowwy1 👍 2
I think it's C. Add a unique field to each row.
Rakesh16 👍 1 Selected: C
Add a unique field to each row
Naqib 👍 4
A Quoted from https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals: "In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping."
semauni 👍 7 Selected: C
"In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping." I was leaning towards A because of the word 'index', and usually if a specific term is mentioned, Microsoft wants to hear you use that term. But option A talks about REFERENCING the index in the CODE. The quote above is not about how you write your code (like cgroven mentioned, e.g. df["streetName"] vs. df[1] for example), but it is about how you should modify your data structure and visual to handle the results. If you read the above statement with this distinction in mind, then it clearly reads C.
el00721 👍 1
D. By setting the "Summarize By" property to "None" for all columns, you disable automatic aggregation and ensure all rows, including duplicates, are displayed in the Python visual.
nasra2 👍 2
A: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping.
Training_ND 👍 3 Selected: A
MS ANSWER. https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals
cafb698 👍 3 Selected: A
As much as C is tempting, let's focus on the wording. "Add a unique field to each row". You simply say, "Add another column for unique id" or something like that. In terms of Microsoft ways of asking, it's A.
VishalTile 👍 1
Power BI tends to automatically summarize data in visuals, which can cause rows to be grouped and duplicates to be hidden. The "Summarize By" property controls how data is aggregated in a visual. By setting it to "Do Not Summarize," you prevent the automatic grouping of data, ensuring that all rows, including duplicates, are displayed. None of the other options directly address the issue of rows being grouped and duplicates being hidden in a Power BI visual. So, D is the right choice.
fits08pistils 👍 2
It seems not everyone can read and understand documentation. The following Python script is execute EVERY TIME you use a Python visual: dataset = pandas.DataFrame(column1, column2, ...) dataset = dataset.drop_duplicates() So the ONLY way to prevent the duplicates from being dropped is to have a unique identifier. Ergo, option C is the only possible answer here.
SilvanoRamalho 👍 2 Selected: A
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals --- Respostas "A"... da MS... Em alguns casos, talvez você não queira que o agrupamento automático ocorra ou queira que todas as linhas apareçam, inclusive as duplicadas. Nesses casos, você pode adicionar um campo de índice ao seu conjunto de dados que faz com que todas as linhas sejam consideradas exclusivas e evita o agrupamento.
ziggy1117 👍 2 Selected: C
ANSWER IS C: In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping. This means you need to add an index field column in which case each row will have a unique index value per row
SilvanoRamalho 👍 2 Selected: C
C- ADIONAR UMA COLUA INDICE
Plb2 👍 3 Selected: A
as clearly stated here https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals
mabianco 👍 1
IMO key words in question are "...the visual is grouped automatically..." so reason while duplicate are NOT displayed is the visual, to revert simply change visual property
sabribrk 👍 1
D. Modify the Summarize By property for all columns
woliveiras 👍 4 Selected: A
Index column always guys...
282b85d 👍 1
To ensure all rows appear in the Python visual in your Power BI report, you need to modify how the data is being summarized. Power BI often automatically groups data and displays unique rows based on the "Summarize By" property of the columns. If this property is set to summarize (like sum, average, etc.), it will group the data, and you may not see duplicate rows. To display all rows, including duplicates, you should: D. Modify the Summarize By property for all columns
ZSteward 👍 2
The default aggregation is Don't summarize. so no need for etting the "Summarize By" property to "None" for all columns , C is correct Answer
rlo123 👍 1
D is the most correct answer, A could be used but not as direct as D is. In Power BI, the default behavior for visuals (including Python visuals) is to aggregate data. This means it groups by unique values and may omit duplicate rows. By changing the "Summarize By" property to "Don't Summarize" for the relevant columns, you instruct Power BI to send the raw, unaggregated data to the Python visual. Why other options are less ideal: A. Reference the columns in the Python code by index: This could be a workaround, but it doesn't address the root cause of the issue (automatic aggregation) and makes your Python code potentially less readable. B. Modify the Sort Column By property for all columns: Sorting doesn't prevent aggregation and wouldn't influence the number of rows displayed. C. Add a unique field to each row: This is a valid solution but adds overhead to your data preparation. Changing the "Summarize By" property is likely a cleaner approach.
stilferx 👍 5 Selected: C
IMHO, the answer is C - add unique value (index). It can be found here: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals It says: In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping.
manolet 👍 2 Selected: C
C regarding to the links provided in previous comments
rmeng 👍 3 Selected: C
C (“Add a unique field to each row”) is the correct approach. By adding an index column, you’ll ensure that all rows appear in your Python visual.
Azure_2023 👍 4 Selected: C
C. Add a unique field to each row. By adding a unique field to each row, you ensure that Power BI treats each row as distinct. This can be achieved by incorporating a column that contains unique values for each row (e.g., a row number or a unique identifier). When this unique field is included in the dataset used by the Python visual, Power BI will not aggregate the rows because it recognizes each one as different due to the unique identifier.
[Removed] 👍 8 Selected: C
I think people are misunderstanding what option A is saying. The option says to reference columns INSIDE the Python code by index, which does not help. That means writing df.iloc[:, columnIndex] instead of df[columnName], see Pandas documentation for more on this: https://pandas.pydata.org/docs/user_guide/indexing.html The Microsoft learn article that's referenced several times in these comments clearly says that you need to add a column that's unique to all rows which "causes all rows to be considered unique and prevents grouping" -- this is what option C means.
vish9 👍 3 Selected: C
If we refer to the following link: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals We see the following text: Based on your selections, the Python script editor generates the following binding code. The editor creates a dataset dataframe with the fields you add. The default aggregation is Don't summarize. Similar to table visuals, fields are grouped and duplicate rows appear only once. In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping. You can infer from this that you need to add a unique field for each row. That will make it C
BennyBenz 👍 2 Selected: A
You want to do something impacting the visual.
PCCCCCC 👍 2 Selected: A
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals
CosmicFuzz 👍 2 Selected: C
Gemini AI says C as well
VAzureD 👍 2 Selected: A
Read the link that TashaP gave. https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals "In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping "
GPerez73 👍 2 Selected: C
Agree with TashaP
a_51 👍 6 Selected: C
C - some are saying A for the same link, but A is not saying to add something like a row_number which I think C is saying. https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping.
wellingtonluis 👍 4 Selected: C
If you truly want to have individual rows passed into your visual, you'll need to add unique value to each row of your dataset (such as an auto-incrementing int) to prevent grouping
Araujoleo44 👍 3 Selected: C
C - Pois Se o visual Python estiver agrupando automaticamente os dados e excluindo linhas duplicadas, isso pode indicar que o código Python associado ao visual está realizando algum tipo de agregação ou sumarização dos dados antes de exibi-los. Para garantir que todas as linhas apareçam no visual, você pode precisar ajustar o código Python para que ele não realize essa agregação ou sumarização. Por exemplo, se o código Python estiver usando a função groupby para agrupar os dados, você pode precisar remover ou modificar essa parte do código. Certifique-se de revisar o código Python associado ao visual e ajustá-lo conforme necessário para garantir que todas as linhas sejam exibidas.
estrelle2008 👍 4 Selected: A
Question is focussed on a Python visual, so READ the link that Tasha posted. As it explicit says about a Python visual in PBI: a) The default aggregation is Don't summarize. Similar to table visuals, fields are grouped and duplicate rows appear only once. b) In some cases, you might not want automatic grouping to occur, or you might want all rows to appear, including duplicates. In those cases, you can add an index field to your dataset that causes all rows to be considered unique and prevents grouping.
sraakesh95 👍 3
C - Add a unique (index field) to the dataset As TashaP mentioned, it has been mentioned under the Tips section in this link: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals However, the answer should be C
thuss 👍 3 Selected: A
A, see TashaP's answer. (Just commenting as well as to not have a misleading vote!)
Momoanwar 👍 2 Selected: D
Juste disable summurize in column on visual
olavrab8 👍 3 Selected: D
Summarization should be none
Danialmellfoye 👍 2 Selected: D
Simply right-click the column in visualization pane and choose "Don't summarize" option
IshtarSQL 👍 1
A. Final Answer: def find_indices(l, value): return [ index for index, item in enumerate(l) if item == value ]

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Power BI automatically groups data and removes duplicate rows in Python visuals to optimize performance. To display every row exactly as it exists in the source, including duplicates, you must add a unique field (such as an auto-incrementing index) to the dataset. This forces Power BI to treat each row as distinct, thereby disabling the automatic grouping mechanism.

Why the Other Options Are Wrong

Option A is incorrect because referencing columns by index in Python code (e.g., using iloc) does not change how Power BI aggregates or groups the input data before passing it to the script. Option B involves sorting, which has no effect on duplication or grouping. Option D suggests modifying 'Summarize By' to None, but this property is generally not available or effective for forcing raw row display in Python visuals compared to the documented index solution.

Community Comment Notes

The community consensus strongly supports Option C, citing Microsoft Learn documentation that explicitly states adding an index field prevents grouping. Several users initially considered Option A due to the word 'index,' but clarified that Option A refers to internal Python coding syntax rather than dataset structure. Comments emphasize that the key is making rows unique in the dataset, not manipulating the Python code itself.

Official Reference

Exam Strategy

When dealing with Python visuals in Power BI exams, remember that data preprocessing happens at the dataset level. If the goal is to bypass default aggregation or grouping, look for options involving unique identifiers or indices added to the data model.

Frequently Asked Questions

Why doesn't changing Summarize By to None work?

In Python visuals, the primary method to disable grouping is ensuring row uniqueness via an index field, as the Summarize By property is less reliable for this specific visual type.

What is the difference between Option A and Option C?

Option A refers to Python coding syntax (iloc), while Option C refers to adding a column to the underlying dataset to force distinctness before the script runs.

Related Analysis

Practice All DP-600 Questions

Access 115 questions with complete answers and detailed explanations.

View Full DP-600 Practice Test →

← Back to DP-600 Study Guide