Forum Discussion
Choosing corresponding value from particular column based on given criteria
- 8 years ago
Perhaps something along these lines:
MyDate = VAR VersionNum = CALCULATE(LASTNONBLANK(Query1[Version],1),Query1[cummulative_version_adoption]>=0.5) VAR VersionDate = CALCULATE(MIN([Version_Release_Date]),Query1[Version] = VersionNum) RETURN IF(ISBLANK(VersionDate),"Date NA",VersionNum)
This assumes that Version_Release_Date is text, if it is an actual DATE value you will probably have to convert it to the text representation of the date. You can do that with a CONCATENATE of the Version_Release_Date and "".
- 8 years ago
Hi Anonymous,
As smoupre said, you cannot sombine a text value ("Date NA") and a date type value in a single result. But you could replace "NA" with Blank() if the corresponding version has no release date.
MyDate measure = VAR VersionNum = CALCULATE ( LASTNONBLANK ( Query1[Version], 1 ), Query1[cummulative_version_adoption] >= 0.5 ) VAR VersionDate = CALCULATE ( MIN ( [Version_Release_Date] ), Query1[Version] = VersionNum ) RETURN IF ( ISBLANK ( VersionDate ), BLANK (), VersionDate )Best regards,
Yuliana Gu
Hi Anonymous,
As smoupre said, you cannot sombine a text value ("Date NA") and a date type value in a single result. But you could replace "NA" with Blank() if the corresponding version has no release date.
MyDate measure =
VAR VersionNum =
CALCULATE (
LASTNONBLANK ( Query1[Version], 1 ),
Query1[cummulative_version_adoption] >= 0.5
)
VAR VersionDate =
CALCULATE ( MIN ( [Version_Release_Date] ), Query1[Version] = VersionNum )
RETURN
IF ( ISBLANK ( VersionDate ), BLANK (), VersionDate )
Best regards,
Yuliana Gu
- Anonymous8 years agoNot applicable
Thank You, Yuliana. The solution is working perfectly fine