The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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:
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:
table on power bi:
Has anyone encountered a similar issue or have any suggestions on how to resolve this?
Thank you in advance for your help!
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
Can you please try the above . still issue exist, share the sample data will check it.
Hope it helps
Proud to be a Super User! | |
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
80 | |
78 | |
43 | |
37 |
User | Count |
---|---|
158 | |
111 | |
64 | |
59 | |
54 |