The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello team,
I have a data mart application with an architecture like this:
Step 1: Data is replicated into the mart database via native SQL replication. It lands in a copy of the source table. Call this table T1.
Step 2: An ETL process runs to take the changed data in T1 and process it into a mart dimension table. Call this table T2.
Step 3: Power BI model incremental refresh runs every 30 minutes to pull the latest data from T2 into an import model copy of the table for reporting. Call this import model copy table T3.
Because each of these steps happens on its own frequency, I occaionally get the question, "I've updated my data in (source system), why isn't it in the mart reports?" Accordingly, I would like to develop an audit view for the end users so they can see the progression of their data changes from T1 to T2 to T3. Basically a live look at where their data is in the process of the three steps.
My first solution for this goes like so:
1. I already have the import model for reporting that contains T3. To this, I add DQ copies of T1 and T2.
2. Next, create a caclulated table in the model that unions a common status query run against the DQ copies of T1 and T2, and the import copy of T3.
3. Last, create a PBI visual that pivots the calculated table so that I can see the source table name and the status at T1, T2, and T3 all in a row in the same matrix.
My thinking here was that when I run the report containing the visual, I'd get a live look at the status of T1 and T2 (since the calculated table is sourcing them via DQ), combined with the state of T3 as of the last model refresh.
Alas, not the case. I've not worked with a calculated table in this way before, and so I learned here that the live portion of it doesn't work the way I was hoping. The table itself has to be recalculated to get the latest (just querying it via the report won't do it), and so my viz will only display the status of T1 and T2 (along with T3) as of the last model refresh.
Any suggestions for a different way to accomplish what I want? I think my ability to do things inside a pbix is limited since I am dealing with a published semantic model, and again I need to normalize and bring together data from three separate tables for display in one visual, perserving the "real time" DQ nature of two of them.
Thank you.
Solved! Go to Solution.
This avoids static calculated tables and gives you the real-time audit view.
I have found a solution that works. Here is a summary of my approach.
I kept my original problem description generic for simplicity, but I actually have an additional complexity that factored into the problem. I described tables T1, T2, and T3, but I actually want to track the status of two sets of tables that are sliceable by a common dimension. So in reality I have T1-1, T1-2, T1-3, and T2-1, T2-2, and T2-3. And I want to lay them out in a row in a PBI visual, sliced horizontally by the dimension.
The crux of the solution was in fact a key table. What I did:
One hitch in all this was the relationships. There are no RI violations in any of the resulting relationships, and the model allowed me to pul the measures across for the T*-2 relationships just fine. But it refused to let me do so for T*-3 for some reason, giving the "no relationship in the current context" error. Fortunatley, in my PBI report I could create the T*-3 measures anyway, so I got there in the end. But I'll have to figure out at some point why the model doesn't like my T*-3 relationship for that use.
But, in the end, it all works.
This avoids static calculated tables and gives you the real-time audit view.
Thank you for your reply. I think I've concluded that what I want to do is, surprisingly, not possible.
I started going down the road of a keys table as you and most of the other respondents have suggested. The keys table itself is quite easy, as it is just a view on the appropriate columns in T1. But then all roads are blocked.
Because there is time delay in the data moving from T1 to T2 to T3, I can't set up a 1:1 relationship between the keys table and T2 and T3, since some key values may not exist in those two tables yet at any point. So it has to be 1:many, which in turn prohibits the use of RELATED on the keys table to build calculated columns or measures using values from T2 and T3.
LOOKUPVALUE would be an acceptable workaround to that problem, except that the keys table has to be DirectQuery so that the values pulled from T2 (which is also DQ, whereas T3 is import) are live. And LOOKUPVALUE is not available with DQ tables. Switching the keys table to Import would be OK, because the key values for each day are actually set early in the day and don't change -- except that then I won't get the live pull from T2 except when the model is refreshed.
So, then, I think this is impossible, or least impossible to do in one PBI visualization.
I have found a solution that works. Here is a summary of my approach.
I kept my original problem description generic for simplicity, but I actually have an additional complexity that factored into the problem. I described tables T1, T2, and T3, but I actually want to track the status of two sets of tables that are sliceable by a common dimension. So in reality I have T1-1, T1-2, T1-3, and T2-1, T2-2, and T2-3. And I want to lay them out in a row in a PBI visual, sliced horizontally by the dimension.
The crux of the solution was in fact a key table. What I did:
One hitch in all this was the relationships. There are no RI violations in any of the resulting relationships, and the model allowed me to pul the measures across for the T*-2 relationships just fine. But it refused to let me do so for T*-3 for some reason, giving the "no relationship in the current context" error. Fortunatley, in my PBI report I could create the T*-3 measures anyway, so I got there in the end. But I'll have to figure out at some point why the model doesn't like my T*-3 relationship for that use.
But, in the end, it all works.
Hi @markmsc ,
Thank you for reaching out to the Microsoft fabric community forum.
I would also take a moment to thank @Shahid12523 , @pankajnamekar25 , @MohamedFowzan1 for actively participating in the community forum and for the solutions you have been sharing in the community forum. Your contributions make a real difference.
In Power BI, calculated tables only refresh when the dataset is refreshed, so they cannot show the live status from DirectQuery tables. Because of this, it is not possible to see T1/T2 (live) and T3 (import) together in one visual exactly the way you are trying.
The practical options here are:
Show T1/T2 in one visual and T3 in another, so users can still compare the status side by side.
Or, create an audit/status table in your data mart/ETL itself which tracks movement from T1→ T2 → T3, and then bring that table into Power BI.
Hope this helps if you have any queries we are happy to assist you further.
Best Regards,
Community Support Team.
Hello, and thank you for your reply, and the suggestion. Please see my replies to @Shahid12523 for an explanation of my solution to the problem.
Hello @markmsc
You can explore any of below options
Use DAX measures query T1 (DQ), T2 (DQ), and T3 (Import) directly, and display them side by side in a matrix.
Composite model keep T3 as Import, T1/T2 as DQ, join them via a common key, and use visuals instead of a union.
Audit fact table upstream create a dedicated status-tracking table in the mart/ETL and bring that into Power BI.
SQL view union T1 and T2 in the database and display alongside T3 in Power BI.
Hello, and thank you for your reply, and the suggestions They were helpful in thinking through the problem. Please see my replies to @Shahid12523 for an explanation of my solution to the problem.
Hi @markmsc
Calculated tables are static and only refresh during dataset refresh, so they definitely cannot reflect live changes from DirectQuery sources. Its also a limitation to actually create this with tables of different connectivity.
If possible to create DAX Measures which query the tables and provide the intended result would make it easy to displaye the fields within the same visual
Hello, and thank you for your reply, and the suggestion. Please see my replies to @Shahid12523 for an explanation of my solution to the problem.
User | Count |
---|---|
69 | |
69 | |
66 | |
54 | |
28 |
User | Count |
---|---|
112 | |
82 | |
66 | |
48 | |
43 |