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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
vi_dataanalyst
Regular Visitor

Correct Values in Power Query but Showing as 0 in Power BI

Hello everyone,

 

I am encountering an issue with my Power BI report where the values of a specific column display correctly in Power Query but show as 0 in Power BI. Here are the details:


I used the following code to create a table that counts the number of columns in each table within my data model:

let
// Get the list of all tables in the data model
Model = #sections[Section1],
TableNames = Record.FieldNames(Model),

// Function to count the number of columns in a table
CountColumns = (TableName) =>
let
TableData = Record.Field(Model, TableName),
ColumnCount = Table.ColumnCount(TableData)
in
ColumnCount,

// Create a list of pairs (Table Name, Number of Columns)
TableData = List.Transform(TableNames, each [Nom_Table = _, Nb_colonnes = CountColumns(_)]),

// Convert the list to a table
ResultTable = Table.FromRecords(TableData)
in
ResultTable

 

The table contains two columns:

  • Nom_Table (Table Name)
  • Nb_colonnes (Number of Columns)

In Power Query, I can see both columns with the correct values. However, when I load the data into power BI, the Nb_colonnes column shows only 0s, except when I include the table itself (the table that provides the count of columns per table). For this specific table, the Nb_colonnes values appear correctly in both Power Query and Power BI.

There are no errors during the data load process, and the data type for Nb_colonnes is correctly set to integer.

 

I have tried to verify the data types in Power Query (tried with text and number types), refreshed the data multiple times, checked for any potential issues with the source data and permissions.

table on power query:

FinalTable.png

table on power bi:

tables_power_bi.png

 

tables_2_powerbi.png


Has anyone encountered a similar issue or have any suggestions on how to resolve this?

Thank you in advance for your help!

1 REPLY 1
rajendraongole1
Super User
Super User

Hi @vi_dataanalyst - Can you try with a blank query, to get generate the table with column details as below

 

let
Source = financial,
ColumnCount = Table.ColumnCount(financial)
in
ColumnCount

 

rajendraongole1_0-1723173760679.png

 

 

Can you please try the above . still issue exist, share the sample data  will check it.

 

Hope it helps





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

Proud to be a Super User!





Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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