Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 planid=related(planid). Is there a way to get it without calctable.
condition:
if cdate<=Monthlydate and st="open" then update 1 for the entire planid (all 3 rows of planid=1)
id,cdate,Monthlydate,st, calccolumn
1,01/13/2017,01/31/2017,open,1
1,01/13/2017,02/28/2017,closed,1
1,01/13/2017,03/31/2017,closed,1
4,01/13/2017,04/30/2017,closed,0
Thank you.
Solved! Go to Solution.
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
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
)
Hey,
just for my understanding, i try to rephrase your requirement
Is my understanding correct?
yes. if atleast one row of a group(id) satisfies then the entire group id (planid=1) is 1.
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
)
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 135 | |
| 102 | |
| 67 | |
| 65 | |
| 56 |