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 have the above model in my Power BI Desktop file and I am trying to do the following -
I have calculated the Version where the cummulative_version_adoption reaches atleast 50 percent for the first time(>=0.5) through the following measure.
Version_Rolled_Down = CALCULATE(LASTNONBLANK(Query1[Version],1),Query1[cummulative_version_adoption]>=0.5)
which gives me 97333.
Similarly, I am trying to calculate the Version_release_date of the Version where the cummulative_version_adoption reaches atleast 50 percent for the first time i.e., (>=0.5). If the corresponding version has date, then it needs to return that date or else "Date NA".
So from above, I would be picking up 13/08/2014.
But I am not able to do so for the dates as you can see I do not have dates available for every version and also lastnonblank requires me to have all the dates for the versions and also them to be in proper descending order.
It would be really helpful if someone can help me out on this.
Thank You.
Regards,
Sudhamshu
Solved! Go to Solution.
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 "".
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
Thank You, Yuliana. The solution is working perfectly fine
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 "".
Thank You, smoupre. The solution is working.
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 |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |