Forum Discussion
Row Identifier within Power BI for Desktop (Circular dependencies with the DAX CALCULATE function)
I'm using Power BI for Desktop and I'm using the CALCULATE function. After attempting to create another Column using Calculate I get a "circular dependency" error.
Doing some research on my own I found the following: https://www.sqlbi.com/articles/understanding-circular-dependencies/
Is there a way to accomplish the following within PowerBI for Desktop?
"2. You can manually set the property of Row Identifier for ProductKey to TRUE using the Properties window inside SSDT or the corresponding feature in PowerPivot"
Thanks!
7 Replies
- konstantinosMemorable Member
This is a working in Tabular and Visual Studio SSDT..also in PowerPivot advanced table properties..not yet implemented in PBI Desktop..You can try the latest
For example, using ALLEXCEPT to remove the calculated columns from the set of columns that become part of the dependency list is a viable option, but it makes all formulas more complicated. On the other hand, using ALLEXCEPT might be useful for very big tables, where the addition of a row identifier would cause memory footprint to grow too much.
The second calculated column will be like = CALCULATE ( your measure ( and filters ) ; ALLEXCEPT ( TableName; TableName[FirstCalculatedColumn])
Never tried it but probably will work ( since Alberto says it will )
- WillTCommunity Admin
If memory footprint isn't an issue for you, there's also an 'Add Index Column' transformation that you could use in the Query Editor. That would be a quick way to add an index that you can use as a Row Identifier.
Please mark either this post or Konstantinos' answer as a solution so we know the problem's solved!
thanks!
- Brian_MContinued Contributor
Hi WillT / konstantinos,
I realise this is an old post. Just wondering whether or not Power BI Desktop has received the functionality to set a column as a row identifier yet? I've read the helpful sqlbi posts above and understand the alternative approaches, just wondering whether the feature has made its way from tabular to PBI Desktop.
Many thanks!
- lsutreyNew Member
Hi Konstantinos,
Your suggestion worked, but you actually have to apply the ALLEXCEPT filter to all of the calculated columns, not just the 2nd column. Once I did it to both of mine, the error went away. I presume if I do a 3rd calculated column, I'll have to update the first two as well. Cumbersome, but at least it works. Thanks for your suggestion!
Trey Cook
- geraldcousiFrequent Visitor
I'm wondering if the "row identifier" feature is now available in PowerBI Desktop ?
I've worked around the circular dependencies within Power Pivot, and it's also fine in PowerBI desktop after importing data model from Power Pivot.
But is there any option to directly manage the property directly within PowerBI desktop ? As far as I would like to use that property for an already existing daya model, created only with PowerBI desktop.
Regards.