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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jcruise
Regular Visitor

Values from merged queries not showing in power bi

I am having an issue with values showing up in Power BI. As you can see in the images below, when I am in the Query Editor, there are values in the query, but when I load in Power BI, I do not see anything.

 

The values are brought into my query via merged queries (first two columns) and then calculated queries (second two columns).

 

 

 

Power BI Image.JPGPower Query Image.JPG

4 REPLIES 4
v-yuezhe-msft
Employee
Employee


 

The values are brought into my query via merged queries (first two columns) and then calculated queries (second two columns).

 

 

 

Power BI Image.JPGPower Query Image.JPG


Hi @jcruise,

What is your data source? Please share us source file for further troubleshooting if possible.  

Also would you please post screenshots about that how you take the "merge queries" and "calculated queries"  operation?

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lydia,

First: I bring the data in from SQL Databases as follows (Query named Staging):

let
    Source = Sql.Database("admin-dwreports", "Marketing"),
    #"Filtered Rows" = Table.SelectRows(Source, each Text.EndsWith([Name], "1_AccountView") or Text.EndsWith([Name], "0_AccountView") or Text.EndsWith([Name], "9_AccountView") or Text.EndsWith([Name], "8_AccountView")),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Name"}),
    #"Invoked Custom Function" = Table.AddColumn(#"Removed Other Columns", "fnSummarizeAccountView", each fnSummarizeAccountView([Name]))
 in
 #"Invoked Custom Function"

 

Second: I created three identical queries to get my basic values and then merge them into one using prior year (PY) date to match with date of the record:

let
    Source = Staging,

...(excluded some filtering, change types not pertinent) 

 

//created some prior year and prior quarter dates to match with record
    #"Inserted PY" = Table.AddColumn(#"Changed Type", "EndOfYear", each Date.AddYears(Date.EndOfYear([fnSummarizeAccountView.BusinessDate]),-1), type date),
    #"Inserted PQ" = Table.AddColumn(#"Inserted PY", "EndOfQuarter", each Date.AddQuarters(Date.EndOfQuarter([fnSummarizeAccountView.BusinessDate]),-1), type date),
    #"Renamed Columns" = Table.RenameColumns(#"Inserted PQ",{{"EndOfYear", "PY"}, {"EndOfQuarter", "PQ"}}),

 

//merged queries based on date of the PY/PQ dates with similar base queries  

  #"Merged Queries" = Table.NestedJoin(#"Renamed Columns",{"PY", "fnSummarizeAccountView.Division", "fnSummarizeAccountView.PBRegion", "fnSummarizeAccountView.PBBranch", "fnSummarizeAccountView.Category", "fnSummarizeAccountView.Classification"},PY,{"fnSummarizeAccountView.BusinessDate", "fnSummarizeAccountView.Division", "fnSummarizeAccountView.PBRegion", "fnSummarizeAccountView.PBBranch", "fnSummarizeAccountView.Category", "fnSummarizeAccountView.Classification"},"NewColumn",JoinKind.LeftOuter),
    #"Expanded NewColumn" = Table.ExpandTableColumn(#"Merged Queries", "NewColumn", {"fnSummarizeAccountView.SumNSBalance"}, {"NewColumn.fnSummarizeAccountView.SumNSBalance"}),
    #"Renamed Columns1" = Table.RenameColumns(#"Expanded NewColumn",{{"NewColumn.fnSummarizeAccountView.SumNSBalance", "PYBalance"}}),
    #"Merged Queries1" = Table.NestedJoin(#"Renamed Columns1",{"PQ", "fnSummarizeAccountView.Division", "fnSummarizeAccountView.PBRegion", "fnSummarizeAccountView.PBBranch", "fnSummarizeAccountView.Category", "fnSummarizeAccountView.Classification"},PQ,{"fnSummarizeAccountView.BusinessDate", "fnSummarizeAccountView.Division", "fnSummarizeAccountView.PBRegion", "fnSummarizeAccountView.PBBranch", "fnSummarizeAccountView.Category", "fnSummarizeAccountView.Classification"},"NewColumn",JoinKind.LeftOuter),
    #"Expanded NewColumn1" = Table.ExpandTableColumn(#"Merged Queries1", "NewColumn", {"fnSummarizeAccountView.SumNSBalance"}, {"NewColumn.fnSummarizeAccountView.SumNSBalance"}),
    #"Renamed Columns2" = Table.RenameColumns(#"Expanded NewColumn1",{{"NewColumn.fnSummarizeAccountView.SumNSBalance", "PQBalance"}, {"fnSummarizeAccountView.SumNSBalance", "SumNSBalance"}, {"fnSummarizeAccountView.Classification", "Classification"}, {"fnSummarizeAccountView.Category", "Category"}, {"fnSummarizeAccountView.PBBranch", "PBBranch"}, {"fnSummarizeAccountView.PBRegion", "PBRegion"}, {"fnSummarizeAccountView.Division", "Division"}, {"fnSummarizeAccountView.BusinessDate", "BusinessDate"}}),
  

//calculated columns below to get year to date and quarter to date

  #"Inserted Subtraction" = Table.AddColumn(#"Renamed Columns2", "Inserted Subtraction", each [SumNSBalance] - [PYBalance], type number),
    #"Inserted Subtraction1" = Table.AddColumn(#"Inserted Subtraction", "Inserted Subtraction.1", each [SumNSBalance] - [PQBalance], type number),
    #"Renamed Columns3" = Table.RenameColumns(#"Inserted Subtraction1",{{"Inserted Subtraction", "YTDGrowth"}, {"Inserted Subtraction.1", "QTDGrowth"}})
in
    #"Renamed Columns3"

Hi @jcruise,

When you create a table visual using these fields (PYBalance,PQBalance,YTDGrowth,QTDGrowth) in Report view of Power BI Desktop, are there any results?


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lydia @v-yuezhe-msft,

 

I think I have found my issue with the underlying data. I think the structure of my queries is not very functional. Thanks for the help!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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