Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi, I created a Semantic model with Fabric and imported it into PowerBI (Get data - Power BI Semantic models). This works. The tables and relationships appear in PowerBI, and I can calculate measures. Then I change the storage from live to direct query (not to import). This step allows me to create calculated columns. But then the problem arises: in tables on the ‘one’ side of a ‘one-to-many’ relationship, RELATED cannot be used towards the ‘many’ side. The suggestions for columns do not appear when I type the formula. If I write it out anyway, I get a circular dependency error. What is going wrong?
Also tested the exact same tables and calculated columns on a direct API source (so not Fabric) with Import mode. Had no problems there.
'Import mode' would be fine for this dashboard, but I can't figure out how to change it. Bottom right text button isn't active.
Solved! Go to Solution.
My solution has been to change all Calculated columns which depended on RELATED, to m-code query columns. This also removed any circular dependencies. But it took a couple of hours and ended up with AI-generated m-code that's too complex for me to understand.
My solution has been to change all Calculated columns which depended on RELATED, to m-code query columns. This also removed any circular dependencies. But it took a couple of hours and ended up with AI-generated m-code that's too complex for me to understand.
You're using a CC in 'PW SHV DossierworkFlow' that references a column in 'PW SHV Task', which in turn filters 'PW SHV DossierworkFlow'. In a Fabric semantic model (similar to Power BI tabular model), relationships are unidirectional, meaning that columns cannot reference measures or calculated columns that depend on them.
Instead of using a CC, you can use a measure that calculates the minimum Startdatum actie dynamically:
FirstStartDate =
VAR KeyValue = SELECTEDVALUE('PW SHV DossierworkFlow'[WorkflowSleutel])
RETURN
CALCULATE(
MIN('PW SHV Task'[Startdatum actie]),
'PW SHV Task'[WorkflowSleutel] = KeyValue
)
If you must have it as a column you can create it in Power Query, just merge 'PW SHV Task' with 'PW SHV DossierworkFlow' using WorkflowSleutel and then computeMin(Startdatum actie) for each WorkflowSleutel.
Last step expand and store the result in 'PW SHV DossierworkFlow'.
Hi Amerah,
Big thanks for the quick response!
First of all, yes, I can make these in M-code. But to illustrate my case I took the easiest column as an example. The other calculated columns depend on multiple conditions which would require a considerably higher number of query steps. However I get the impression that that would still be preferable.
Second is that your solution works, but only for a single calculated column. If I want to add a second one, for instance a LastStartDate using MIN instead of MAX, I get the circular error again. I don't understand why. They use the same selectedvalue of WorkflowSleutel and the same range of Startdates of Task, just to calculate a min instead of max, right? I don't see the loop here.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
80 | |
53 | |
39 | |
39 |
User | Count |
---|---|
104 | |
85 | |
47 | |
44 | |
43 |