directquery
11 TopicsWhen using DAX in a semantic model will Fabric fall back to Direct Query
We have a semantic model created and inside we have a main date table. We wanted to create other tables based on this date table, whilst still using DirectLake for performance. Initially we tried creating views but realised that views fall back to DirectQuery mode when trying to use them in a filter. So I wondered if alternatively we could use DAX instead? Reading through the documentation here Direct Lake overview - Microsoft Fabric | Microsoft Learn it mentions "Import and Direct Lake storage modes use the VertiPaq engine to process DAX queries and return results to the Power BI report and user" so I presume that mean it won't fall back to DirectQuery mode but I wanted to check before I start the laborious process of changing them all to DAXSolved1.5KViews0likes6CommentsDirectQuery latitude and longitude for map
I'm working on a project where we have an MQTT GPS locator on our site. We want to display that locator's current location. We are sending the sensor's data to a Streaming Dataset. I can see and create a table with all of the updates (I have a timestamp and an "ID" where I'm evaluating the time in UNIX format to give a unique identifier). I want to show the current location, therefore the most recent snapshot. I keep getting stuck evaluating the last row due to DirectQuery restrictions. I finally got calculate(max...)) and lookupvalue to give me a single latitude and longitude, but when I put those into the Map visual I get "To display latitude and longitude pairs, set the aggregate for Latitude and Longitude to Don't summarize" which I can't do with a measure. I was worried Map was aggregating the values anyway (dispite there being only one value), but I can't make a measure that it will take as a Location. Feeling stuck on something seemingly simple!!!!Solved1KViews0likes5CommentsHelp with FIFO logic with two Tables in DirectQuery
Hello, I'm struggling with creating a way to measure and/or visualize if a Load Unit that has been delivered to us, was also unloaded first. Deliveries have Priority 1-3 so what we want is, that the first delivery arrived is also the one that is unloaded first. I'm stuck with working in DQ and have to tables to do this- Transports Table and Unloading Table Transports Table has the Columns LoadUnitId, Priority and ActualArrival Timestamp. Unloading Table has the column StarTime Unloading. Something like this: LoadUnitId Priority ActualArrival StartTime Unloading 1234 1 01.01.2025 08:00 01.01.2025 08:15 4321 2 01.01.2025 07:35 01.01.2025 07:56 2134 1 01.01.2025 07:15 01.01.2025 08:19 What kind of expression can be used to check if a Load Unit that has the same priority, was delivered before another one, but unloaded later. I've been thinking of using Ranks but DirectQuery is a bit tricky and won't allow that. Maybe Flags would do the trick but I'm unsure how to use them in this case exactly. Any help would be highly appreciated. Thank you very much 🙂845Views0likes6CommentsHow to create dynamic filter in DAX query
Hello, I want to dynamically filter my data in PBI Report Builder using DAX expression. The columns in the filter will be added dynamically based on what the user selects in the report. It is a embedded paginated report with a PBI Semantic model as it's dataset. The PBI Semantic Model dataset is created using DirectQuery. I am sharing the semantic model between PBI Report and Paginated Report. Paginated Report is required to export the tabular report data. I am using the following DAX : DEFINE VAR filters = IF(NOT(ISBLANK(@param1)), "MyTable[col1]=" & @param1, BLANK()) EVALUATE FILTER(MyTable, filters) I get the following error: The query contains the 'param1' parameter, which is not declared. Please note that I have created a Query Parameter named param1 in the DataSet properties and associated it with respectvie report parameter. The report parameters are passed to the report in the payload. Need help. Thank youSolved2.1KViews0likes3Commentsis it possible to publish report consist of column that's LOOKUPVALUE-ing towards DirectQuery data?
Is it possible to publish a Power BI report with a table that contains columns created using LOOKUPVALUE on DirectQuery data? I'm already a Pro user. I encountered several error messages with this setup before, but I'm not sure if this was the actual problem. Table 1 (local) : No Item 1 Apple 2 Banana 2 Banana 3 Orange 4 Guava 4 Guava Table 2 (direct query) No Status 1 True 2 False 3 True 4 False = LOOKUPVALUE('Table 2'[Status],'Table 2'[No],'Table 1'[No]) Table 1 result: No Item Status 1 Apple True 2 Banana False 2 Banana False 3 Orange True 4 Guava False 4 Guava False Need help, thanks!Solved600Views0likes2CommentsDirectquery limitation summarize
Hi, Context: I have a table with 7 billion rows in bigquery, the table is partitioned and clustered and performs well when sending queries. I'm trying to get the number of unique users based on a certain condition and the following SQL syntax works perfectly. SELECT COUNT(DISTINCT users) AS cnt_users FROM ( SELECT users, AVG(transactions) AS transactions FROM `project.dataset.canales` WHERE Date BETWEEN '2023-10-01' AND '2023-11-05' GROUP BY users) WHERE transactions BETWEEN 15 AND 25; The result is one row with the value and the query runs in 2-3 seconds. When translate this query to dax: light_users = VAR _users = SUMMARIZECOLUMNS ( canales[users], "avg_trx", AVERAGE ( canales[transactions] ) ) VAR _filter = FILTER ( _users, [avg_trx] >= 15 && [avg_trx] <= 25 ) RETURN COUNTROWS ( _filter ) The result in power bi is Looking at the query created by Dax in bigquery I can see that Dax created a temp table but the quantity is 1+ million records The table returns to Power BI to make the final calculation. So, How can I calculate all directly in the source and solve the problem with the returned rows? I tried using vars, without vars and nothing works for me. Thanks1.2KViews0likes4CommentsPowerBI- How to write a calculate column when two tables have many to one relationship?
Hi, I have two table App(one relationship) and App Role(Many relationship). The direction of filteration is from App to App Role. This is a directquery model so RELATED, RELATEDTABLE are not supported functions. I have two columns(Role, Type) in App role table. I am writing a IF condition in App table something like below but I get only 0's. PrimaryB_Individual(A calculated column I created in App Role table): PrimaryB_Individual = IF( 'App Role'[Role] = "PB" && 'App Role'[App Type]= "Individual", 1, BLANK()) Level 1 is in App Table. This formula only gives me 0. Level 1 = IF( IF(not ISEMPTY( 'App'), SELECTEDVALUE('App Role'[PrimaryB_Individual]) ) && 'App'[TBUS] <=24 && 'App'[NE] = "Existing", 1,0 ) Any comments on what am I missing?Solved2.7KViews0likes13CommentsConnecting to Mysql as directQuery mode using Mariadb Connector
Hello, We have a requirement to monitor frequently updated data via Power bi and will be embedded in a web application, the data source is actually Mysql, Since MySQL Does not support DirectQuery Mode, I managed to connect to it via a MariaDB connector (which is usable to connect to Mysql Database), and the DirectQuery works perfectly fine with MySQL using this connector, I also managed to set up a gateway so it could connect to our locally hosted virtual machine that hosts the Mysql server, Everything seems to work fine. My question is, is this approach reliable enough to go to production? Should I expect any "weird" behavior, for example, if the data grows? I appreciate your help.Solved2.7KViews0likes1CommentHow do I select which tables to calculate on based on the date?
I have 4 tables, say, data_2020, data_2021, data_2022, and calendar, which are all connected through DirectQuery (because each dataset is too large), except for the calendar table, which is just a lookup table. Now, for example, I want to calculate the total profits. So, I have a DAX measure that is defined as Total Profit = SUM('data_2022'[total_profit]) + SUM('data_2021'[total_profit]) + SUM('data_2020'[total_profit]) But I was told that this would still genearate queries for the data_2021 and data_2020 tables even if 'calendar'[date] is filtered to show only data for 2022. I have (I think) a solution that is more optimized and it is defined as Total Profit = VAR last_date_2021 = CALCULATE(LASTDATE('data_2021'[date]), ALL('data_2021'[date])) VAR last_date_2020 = CALCULATE(LASTDATE('data_2020'[date]), ALL('data_2020'[date])) RETURN SUM('data_2022'[total_profit]) + IF(MIN('calendar'[date]) < last_date_2021, SUM('data_2021'[total_profit])) + IF(MIN('calendar'[date]) < last_date_2020, SUM('data_2020'[total_profit])) But this only works best if I filter the minimum date in 'calendar'[date]; I don't think it would optimize the cases wherein, for example, I set the max date to be 2021 or earlier. How do I improve on this? Any help would be much appreaciated. Thank you in advance.995Views0likes4Commentsfunction CALCULATE in Direct Query?
Hi Guys. Currently I use this code to find the last position of a counter for a team within the same column, which is fed by multiple teams. The model was in import mode, which presented several connection problems with other DirectQuery tables, I want to convert the table to DirectQuery but it tells me that I cannot use CALCULATE for DirectQuery, how can I find this same result without having formula restriction in DirectQuery4.6KViews0likes1Comment