Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kulkarnipriya87
Helper IV
Helper IV

Circular Dependencies

Equity Purchase =

VAR A =
    IF(
        'Deal Apr 15- Sep15A'[DL_CLASS] = 1 &&
        'Deal Apr 15- Sep15A'[DEAL_CD] = 4 &&
        'Deal Apr 15- Sep15A'[INSTR_SUB_TYPE] IN {"EQ", "EU", "NC", "PT", "RF"},
        [SUM NET AMT Sale],
        BLANK()
    )Return
    A

Equity Sales =
VAR B =
    IF(
        'Deal Apr 15- Sep15A'[DL_CLASS] = 1 &&
        'Deal Apr 15- Sep15A'[DEAL_CD] = 3 &&
        'Deal Apr 15- Sep15A'[INSTR_SUB_TYPE] IN {"DS", "ET", "IS", "OM", "LS", "ES", "BD", "BN", "CCD", "CD", "CP", "DB", "FD", "GS", "PR", "SR", "ZD"},
        [SUM NET AMT Sale],
        BLANK()
    )
    Return
    B
Equity Purchase and Equity Sales are two calculated columns in Power BI.
Getting the correct value for Equity Purchase.But while executing Equity Sales getting an error of circular dependencies.
If I create a measure instead of a column it did not accept columns from the table.
I want to calculate Equity Purchase - Equity Sales.



1 ACCEPTED SOLUTION
kulkarnipriya87
Helper IV
Helper IV

Problem Solved.

Instead of creating calculated columns, I have created measures.
Like this.
Equity Purchase Measure =
VAR A =
IF(
'Deal Apr 15- Sep15A'[DL_CLASS] = 1 &&
'Deal Apr 15- Sep15A'[DEAL_CD] = 4 &&
'Deal Apr 15- Sep15A'[INSTR_SUB_TYPE] IN {"EQ", "EU", "NC", "PT", "RF"},
[SUM NET AMT Sale],
BLANK()
)
RETURN
A



View solution in original post

6 REPLIES 6
kulkarnipriya87
Helper IV
Helper IV

Problem Solved.

Instead of creating calculated columns, I have created measures.
Like this.
Equity Purchase Measure =
VAR A =
IF(
'Deal Apr 15- Sep15A'[DL_CLASS] = 1 &&
'Deal Apr 15- Sep15A'[DEAL_CD] = 4 &&
'Deal Apr 15- Sep15A'[INSTR_SUB_TYPE] IN {"EQ", "EU", "NC", "PT", "RF"},
[SUM NET AMT Sale],
BLANK()
)
RETURN
A



kulkarnipriya87
Helper IV
Helper IV

Then what is the solution?

Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

https://www.dropbox.com/scl/fi/q5v16m78oplgd41zi02gn/Sample.xlsx?dl=0&rlkey=lnthochv65j7zrgc1jf5yock...

You can download data from above link.                                                          

Equity Purchase - Data with other than DS,ET. IS OM,LS, ES,BD ,BN,CCD,CD,CD,CP DB,FD, GS,FD,PR ,SR,ZD from colunm (INSTR_SUB_TYPE) and DL_CLASS where 1 code and DEAL_CD with 4 code.


Equity Sale - Data with DS,ET. IS OM,LS, ES,BD ,BN,CCD,CD,CD,CP DB,FD, GS,FD,PR ,SR,ZD from colunm (INSTR_SUB_TYPE) and DL_CLASS where 1 code and DEAL_CD with 3 code.


Net Investment = Equity Purchase - Equity Sale



lbendlin
Super User
Super User

You are using measures inside your column definitions. That won't work.

Equity Sales =

VAR B =

    IF(

        'Deal Apr 15- Sep15A'[DL_CLASS] = 1 &&

        'Deal Apr 15- Sep15A'[DEAL_CD] = 3 &&

        'Deal Apr 15- Sep15A'[INSTR_SUB_TYPE] IN {"DS", "ET", "IS", "OM", "LS", "ES", "BD", "BN", "CCD", "CD", "CP", "DB", "FD", "GS", "PR", "SR", "ZD"},

        SUM('Deal Apr 15- Sep15A'[NET_AMT]),

        BLANK()

    )

    Return
    B

If I use this instead of measure, getting the wrong values.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.