Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I managed to create a column for variance using the dax below
The same Circular Dependency is experienced when I tried to create a dax using If statement so I can create a slicer for variance classified as negative, positive and zero.
Hope someone can help.
//NT
Solved! Go to Solution.
Hi @Anonymous ,
Please try the following formula:
Variance = ([Sales Price] - [Purchase Price]) / [Purchase Price]
Create the new column to classify the variance.
Variance classification =
IF([Variance] > 0, "Positive",
IF([Variance] < 0, "Negative", "Zero")
)
Drag the date column into the slicer visual.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the new column to calculate the Variance.
Variance = CALCULATE(SUM('Table'[Sales Price])) - CALCULATE(SUM('Table'[Purchase Price]))
3.Create the new measure to calculate Margin instead of calculated column.
Margin01 = CALCULATE(SUM('Table'[Variance]) / SUM('Table'[Purchase Price]))
4.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Is it possible to make the variance as columns instead of measure so I can add it into a slicer?
Plus how can i make a slicer to classify the variance based on negative, positive and zero because I tried using the if function but again encountered circular dependency
//NT
//NT
Hi @Anonymous ,
Please try the following formula:
Variance = ([Sales Price] - [Purchase Price]) / [Purchase Price]
Create the new column to classify the variance.
Variance classification =
IF([Variance] > 0, "Positive",
IF([Variance] < 0, "Negative", "Zero")
)
Drag the date column into the slicer visual.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
This blog explains very well about this issue and also it provides the solution. Please refer to it. https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/
Dale
Hi @Anonymous
Did you try using separate measures to classify variance? something like below,
Variance Classification =
VAR CurrentVariance = [Variance]
RETURN
see if these help:
Solved: Circular dependancy error - Microsoft Fabric Community
Solved: Circular dependency - Microsoft Fabric Community
Solved: Circular dependency.....why??? - Microsoft Fabric Community
Solved: Error: circular dependency - Microsoft Fabric Community
IF(
CurrentVariance > 0, "Positive",
IF(CurrentVariance < 0, "Negative", "Zero")
)
Proud to be a Super User!
Hi,
I used your dax but still encountered a circular dependency as shown. Any possible option to fix my problem?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |