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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jstein91694
Frequent Visitor

Create two "filtered" columns utilizing a measure.

I have just created a measure which incorporates data from two different queries. I am now trying to use this measure to create two new columns using a slightly different filter based on existing columns. I am able to create the first of which by doing the following.

SH Input (mmBTU) =
CALCULATE('GAHP-Trane-Canada'[GAHP Gas Input (mmBTU)],
'GAHP-Trane-Canada'[GAHP Gas Use DELTA (cf)]>0,'GAHP-Trane-Canada'[0H AH Supply Air (F)]>100,'GAHP-Trane-Canada'[0E Hyd Supply Tank (F)]<100).

I am trying to create a second column which slightly changes the filter which would look like this;

DHW Input (mmBTU) =
CALCULATE('GAHP-Trane-Canada'[GAHP Gas Input (mmBTU)],
'GAHP-Trane-Canada'[GAHP Gas Use DELTA (cf)]>0,'GAHP-Trane-Canada'[0H AH Supply Air (F)]>100,'GAHP-Trane-Canada'[0E Hyd Supply Tank (F)]>100)

I can successfully create the first column, but by creating the second I have a circular dependency. I was wondering if there is a way to create both columns without a circular dependency since all I am doing is filtering a measure.




1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @jstein91694 ,

 

You could refer to this blog: https://www.sqlbi.com/articles/understanding-circular-dependencies/

“Nevertheless, by using CALCULATE, we are asking to transform the current row context into a filter context and this modifies the dependency list.”

You could edit your both columns with FILTER().

SH Input (mmBTU) =
CALCULATE (
    'GAHP-Trane-Canada'[GAHP Gas Input (mmBTU)],
    FILTER (
        'GAHP-Trane-Canada',
        'GAHP-Trane-Canada'[GAHP Gas Use DELTA (cf)] > 0
            && 'GAHP-Trane-Canada'[0H AH Supply Air (F)] > 100
            && 'GAHP-Trane-Canada'[0E Hyd Supply Tank (F)] < 100
    )
)
DHW Input (mmBTU) =
CALCULATE (
    'GAHP-Trane-Canada'[GAHP Gas Input (mmBTU)],
    FILTER (
        'GAHP-Trane-Canada',
        'GAHP-Trane-Canada'[GAHP Gas Use DELTA (cf)] > 0
            && 'GAHP-Trane-Canada'[0H AH Supply Air (F)] > 100
            && 'GAHP-Trane-Canada'[0E Hyd Supply Tank (F)] > 100
    )
)

 

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

View solution in original post

1 REPLY 1
v-eachen-msft
Community Support
Community Support

Hi @jstein91694 ,

 

You could refer to this blog: https://www.sqlbi.com/articles/understanding-circular-dependencies/

“Nevertheless, by using CALCULATE, we are asking to transform the current row context into a filter context and this modifies the dependency list.”

You could edit your both columns with FILTER().

SH Input (mmBTU) =
CALCULATE (
    'GAHP-Trane-Canada'[GAHP Gas Input (mmBTU)],
    FILTER (
        'GAHP-Trane-Canada',
        'GAHP-Trane-Canada'[GAHP Gas Use DELTA (cf)] > 0
            && 'GAHP-Trane-Canada'[0H AH Supply Air (F)] > 100
            && 'GAHP-Trane-Canada'[0E Hyd Supply Tank (F)] < 100
    )
)
DHW Input (mmBTU) =
CALCULATE (
    'GAHP-Trane-Canada'[GAHP Gas Input (mmBTU)],
    FILTER (
        'GAHP-Trane-Canada',
        'GAHP-Trane-Canada'[GAHP Gas Use DELTA (cf)] > 0
            && 'GAHP-Trane-Canada'[0H AH Supply Air (F)] > 100
            && 'GAHP-Trane-Canada'[0E Hyd Supply Tank (F)] > 100
    )
)

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.