Forum Discussion
Issue in countrows
- 4 years ago
harshagraj , Try if this can help
new column =
var _cnt = countx(filter(Table, [PRJ] =earlier([PRJ]) && [Segment] =71),[PRJ])
var _cnt1 = countx(filter(Table, [PRJ] =earlier([Owner/Partnrer]) && [Segment] = "Partner"),[PRJ])
return
if(not(isblank(_cnt)) && not(isblank(_cnt1)) , "Owner", "Other")
harshagraj , Try a new column like
new column =
var _cnt = countx(filter(Table, [PRJ] =earlier([PRJ]) && [Segment] =71),[PRJ])
return
if(isblank(_cnt),[Segment], "Owner")
Hi amitchandak thanks for the reply but it is not giving me desired solution, in the below ss highlighted ones doesnt have a partner at all.
Partner =
VAR cnt =
COUNTX (
FILTER (
'OS Sales_Project_WonLost_VW',
'OS Sales_Project_WonLost_VW'[SF_Number]
= EARLIER ( 'OS Sales_Project_WonLost_VW'[SF_Number] )
&& 'OS Sales_Project_WonLost_VW'[Segment_code] = "0071"
),
'OS Sales_Project_WonLost_VW'[SF_Number]
)
RETURN
IF ( ISBLANK ( cnt ), 'OS Sales_Project_WonLost_VW'[Segment_code], "Owner" )
- amitchandak4 years agoSuper User
harshagraj , Try if this can help
new column =
var _cnt = countx(filter(Table, [PRJ] =earlier([PRJ]) && [Segment] =71),[PRJ])
var _cnt1 = countx(filter(Table, [PRJ] =earlier([Owner/Partnrer]) && [Segment] = "Partner"),[PRJ])
return
if(not(isblank(_cnt)) && not(isblank(_cnt1)) , "Owner", "Other")- harshagraj4 years agoPost Partisan
Hi amitchandak the above calculations work perfectly but i have an slicer Region Code.
When i modify like this
var _cnt = countx(filter(Table, [PRJ] =earlier([PRJ]) && [Segment] =71&&[Regioncode]=selectedvalue(regoincode)),[PRJ]) it doesnt work but when i modify like this it works var _cnt = countx(filter(Table, [PRJ] =earlier([PRJ]) && [Segment] =71&&[Regioncode]="0401",[PRJ])
could you please help me on this?- harshagraj4 years agoPost Partisan
Hi amitchandak please help me to adjust the calculation so that if we select region code as 0401 then the calcuation should happen accordingly. Currently if i select 0401 it doesnt work.I dont want to hardcode