Forum Discussion
Return Customers count within 2 years
- 5 years ago
Hi, ManjunathaEP
Thank you for your feedback.
I am not 100% sure how your desired outcome looks like in the Calculated Column, but please check the below picture and the link down below.
Expected Result CC =
VAR currentorderno = 'Table'[Order No]
VAR currentdate = 'Table'[Order Date]
RETURN
IF (
COUNTROWS (
FILTER (
'Table',
'Table'[Customer] = EARLIER ( 'Table'[Customer] )
&& 'Table'[Order No] <> currentorderno
&& 'Table'[Order Date]
>= DATE ( YEAR ( currentdate ) - 2, MONTH ( currentdate ), DAY ( currentdate ) )
&& 'Table'[Order Date] < currentdate
)
) > 0,
"return",
"new"
)https://www.dropbox.com/s/qyxu6eb39ic43ma/manjunathaEPv2.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Hi, ManjunathaEP
Thank you for your feedback.
My formula is for creating a calculated measure, not a calculated column. The expected result that was shown in the initial question was a matrix type. So, I thought you wanted to see it by creating a measure, not a calculated column.
Hi Jihwan, I am sorry for the confusion. Yes, I requested help on the calculated measure. Later, I was working on the other alternatives and I tried creating a calculated column. If possible, request you to help and correct me the calculated column measure.
You are always supportive, thank you so much for your guidance.
- Jihwan_Kim5 years ago
Super User
Hi, ManjunathaEP
Thank you for your feedback.
I am not 100% sure how your desired outcome looks like in the Calculated Column, but please check the below picture and the link down below.
Expected Result CC =
VAR currentorderno = 'Table'[Order No]
VAR currentdate = 'Table'[Order Date]
RETURN
IF (
COUNTROWS (
FILTER (
'Table',
'Table'[Customer] = EARLIER ( 'Table'[Customer] )
&& 'Table'[Order No] <> currentorderno
&& 'Table'[Order Date]
>= DATE ( YEAR ( currentdate ) - 2, MONTH ( currentdate ), DAY ( currentdate ) )
&& 'Table'[Order Date] < currentdate
)
) > 0,
"return",
"new"
)https://www.dropbox.com/s/qyxu6eb39ic43ma/manjunathaEPv2.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM