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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |