Forum Discussion
aj1107
9 years agoAdvocate I
calculated column logic.
I need to create a calculated column based on below condition. Not sure how to get the entire planid logic using calc column. i tried to create a calctable of below condition and then update using p...
- 9 years ago
Hey,
you can find a little example
For this table:
A caclculated column using this DAX statement:
calcColumn = if( calculate( count('Table1'[id]), FILTER( ALLEXCEPT('Table1',Table1[id]), 'Table1'[right] > 'Table1'[left] && 'Table1'[literal] = "yes" ) ) >= 1, 1, 2 )Returns these values:
Hope this helps
- 9 years ago
You may refer to the following DAX as well.
calccolumn = IF ( COUNTROWS ( FILTER ( Table1, Table1[id] = EARLIER ( Table1[id] ) && Table1[cdate] <= Table1[Monthlydate] && Table1[st] = "open" ) ) > 0, 1, 0 )
aj1107
9 years agoAdvocate I
yes. if atleast one row of a group(id) satisfies then the entire group id (planid=1) is 1.
v-chuncz-msft
9 years agoCommunity Support
You may refer to the following DAX as well.
calccolumn =
IF (
COUNTROWS (
FILTER (
Table1,
Table1[id] = EARLIER ( Table1[id] )
&& Table1[cdate] <= Table1[Monthlydate]
&& Table1[st] = "open"
)
)
> 0,
1,
0
)