Connection to Big Query from Power BI - Partitioned Table - powerbi

I'm currently trying to import data from Big Query to Power BI, but have been receiving the below error when I load the data to Power BI.
DataSource.Error: ODBC: ERROR [42000] [Microsoft][BigQuery] (70) Invalid query: Cannot query over table 'xxxxx' without a filter over column(s) 'date' that can be used for partition elimination
I've tried changing the type for the column "date", but it didn't resolve the error.

Related

Power BI Min date of each category

I am familiar with SQL and I can write a query to return results of a query to Select MIN(Date), MAX(Date), SUM(quality) and GROUP BY. However, I am new to Power BI and DAX and find it difficult to do the same on Power BI. Below is my situation.
These tables on Power BI:
Dim_ManefactureDate
Dim_ReleaseDate
Fact_OrderID
Table Relationships
Adding a table visualization to a new page to show data from three tables above, data is showing as below:
Under Values of Visualizations, when selecting SUM over Netweight, it automatically summarizes expected Netweight. However, for ManufactureDate and ReleaseDate, when selecting Earliest then Power BI table shows unexpected 1/01/1900 values like this:
I expect earliest date of each OrderID as below:
I have also tried to use a DAX function to create a new column but it gets error
ManufactureDate_Earliest =
VAR Sum_Netweight = SUM(Fact_OrderID[NetWeight])
VAR GroupBy_OrderID = GROUPBY(Fact_OrderID,Fact_OrderID[OrderID])
RETURN
CALCULATE(
MIN(RELATED(Dim_ManufactureDate[DateBK]))
)
Thank you very much for your help
Due to getting values from relationship tables, used these measured and solved the issue
ManufactureDate_Earliest =
CALCULATE(
MIN(ManufactureDate[DateBK]),
CROSSFILTER(Fact_Order[ManufactureDate_DateSK], ManufactureDate[DateSK], BOTH)
)
ReleaseDate_Earliest =
CALCULATE(
MIN(ReleaseDate[DateBK]),
CROSSFILTER(Fact_Order[ReleaseDate_DateSK], ReleaseDate[DateSK], BOTH)
)

Power BI - If a date is between 2 dates using relationships

I am trying to determine if a date is between 2 other dates that are is 2 different tables using
Power BI.
For simplicity, here is the model that I have :
TableB is the bridge table between TableA and TableC.
I have an inactive relationship between tableA and TableC.
I have tried the following logic to check if TableC.createdDate is between TableA.startDate and TableA.endDate :
Create a calculated column in TableC, but I was not able to access columns in TableA
Create a calculated column in TableB, but I was having blank results, which is not suppose to happen
Have you tried using USERELATIONSHIP to force your calculated column to use the inactive relationship to TableA? documentation link
So something like
CALCULATE(
{{created date is >start and <end}},
USERELATIONSHIP('TableA'[TableB_ID],'TableC'[TableB_ID]
)

power bi load rows based on condition in Query editor

I have the blow data
create table #tbl (Continet varchar(40), Country varchar(40), City varchar(40), OrderDate date)
insert into #tbl values
('South America', 'Colombia', 'Angostura', '2020-05-13'),
('Europe','Germany','Thuringia','2019-02-12'),
('Asia','China','Tianjin','2017-11-22'),
('Asia','India ','Hyderabad','2018-02-15'),
('Asia','China','Tianjin','2016-10-30'),
('Europe','United Kingdom', 'Northwich','2015-05-03')
select * from #tbl
drop table #tbl
I am taking the data to power BI and the rows are in millions.
what i want is to Filter the data in Power BI query editor to load only India Data. The data is from google analytics, for simplicity i use sql to give the above data. How can i do it in power query editor
Thanks
Assuming that you know what a sql view is.
Make an sql view -with a proper where- and feed power-bi with its result.

DAX way to get all column names of a table as a list

Is there a way in DAX to get all column names of a table as a list of values? Say we have in a table with 3 columns:
col1 | col2 |col3
I want a dax table (or dax variable) that would retrieve those column names to a single column:
SingleColumn
----
col1
col2
col3
I know that there is solution in PowerQuery for that. I am interested in DAX solution.
If you have deployed a PBI data model in a SSAS server, you can write following DAX query to retrieve all column names for all tables within that SSAS DB with
EVALUATE COLUMNSTATISTICS()
Can only be used as a DAX query

Trying to combines multiple employees' timesheet tables using power query for Power BI report

I am having trouble cleaning the data from timesheet tables from multiple employees.
The timesheets are attendance records and I want to import the data to a single dataset into Power bi for analysis.
The time entries are separated by each employee's Staff ID and dates into a table and there are 78 tables for each employee.
I have tried to use transpose, pivoting the tables, and splitting column 1 with the delimiter of staff ID: but unable to get it to work.
Appreciate the help.