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
orana
Helper I
Helper I

Measures to Columns without circular dependency

Hi,


I have two measures shown below. I'm attempting to convert these measure into columns. I tried to create each VAR as its own measure and then created an if statement. I'm able to create the first column. When attempting to convert the second measure    (B to M PL) into a column, I recieve a circular error. Is there a work around to this? 

 
Only B =
VAR M_Units_2021 = CALCULATE(DISTINTCOUNT(Table1[FYTD Trace Units]),FILTER('Table1',YEAR('Table1'[Fiscal Month-Year].[Date]) = 2021 && 'Table1'[B & M]= "PL"))

VAR B_Units_2020 = CALCULATE(DISTINTCOUNT('Table1'[Prior FYTD Trace Units]),FILTER('Table1', YEAR('Table1'[Fiscal Month-Year].[Date]) = 2020 && 'Table1'[B & M]="B Branded" && 'Table1'[FYTD Trace Units]<>0))

VAR B_Units_2021 = CALCULATE(DISTINTCOUNT('Table1'[FYTD Trace Units]),FILTER('Table1', YEAR('Table1'[Fiscal Month-Year].[Date]) = 2021 && 'Table1'[B & M]="B Branded"&& 'Table1'[FYTD Trace Units]<>0))
RETURN

IF(M_Units_2021=0, "Only B",BLANK())
 
B to M PL =
VAR M_Units_2021 = CALCULATE(DISTINTCOUNT('Table1'[FYTD Trace Units]),FILTER('Table1,YEAR('Table1'[Fiscal Month-Year].[Date]) = 2021 && 'Table1'[B & M]="PL"))

VAR B_Units_2020 = CALCULATE(DISTINTCOUNT('Table1'[Prior FYTD Trace Units]),FILTER('Table1', YEAR('Table1'[Fiscal Month-Year].[Date]) = 2020 && 'Table1'[B & M]="B Branded"))

VAR B_Units_2021 = CALCULATE(DISTINTCOUNT('Table1'[FYTD Trace Units]),FILTER('Table1', YEAR('Table1'[Fiscal Month-Year].[Date]) = 2021 && 'Table1'[B & M]="B Branded" && 'Table1'[FYTD Trace Units]<>0))
RETURN

IF(M_Units_2021 > 0 && B_Units_2021 <> 0 && B_Units_2020 <> 0, "B to M PL",BLANK())
 
2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @orana ,

 

It's hard to figure out what's going on with the formula. Could you please share some sample data so that we could test the DAX formula?

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
TheoC
Super User
Super User

Hi @orana 

 

Although I haven't looked into the detail of your measures, I recommend using Power Query to create Conditional Columns or conditional columns using Custom Column. Once you have created what you can in Power Query, the circular dependency issue should hopefully disappear as the new columns you will attempt to create won't be as reliant on one another in canvas view.

 

I hope the above helps in some way, shape or form.


Best of luck!

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

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.