cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ResearchDev
Helper II
Helper II

HasValue is equivalent to what?

I am trying to convert the below code to a PowerBI Paginated report. What is the best way? If Has value in (:Sample Date) then perform a DateDiff function using Days to count from the difference between 2 days of which one is the data enter during a parameter the user selected date

-----------------------------------------------------------------
if hasvalue ({?Sample Date}) then
DateDiff("d",ITIdtToDate({T_SMPL.SMPL_DT}),{?Sample Date})
else
DateDiff("d",ITIdtToDate({T_SMPL.SMPL_DT}),{@currentdate})

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ResearchDev , if are looking for power bi, then we have hasonevalue https://p3adaptive.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

View solution in original post

2 REPLIES 2
ResearchDev
Helper II
Helper II

I use a query instead. Now when using the query in SQL developer it runs fine and show the number of days between but in report builder. I get a CAST Problem is the one in BOLD. 

ResearchDev_0-1658343469116.png

 



SELECT
T_SMPL.SMPL_ID,
T_SMPL.SMPL_MIX_ID,
T_SMPL.SMPL_DT,
TO_DATE(SMPL_DT,'YYYYMMDD') smpl_dt_disp,
CASE WHEN
T_SMPL.SMPL_DT IS NULL OR T_SMPL.SMPL_DT=0 THEN SYSDATE
ELSE TO_DATE(T_SMPL.SMPL_DT,'YYYYMMDD') END - sysdate Days_Between,
T_PCC.MIX_ID
FROM
SM_ADMIN.T_SMPL T_SMPL
INNER JOIN SM_ADMIN.T_PCC T_PCC ON T_SMPL.SMPL_MIX_ID = T_PCC.MIX_ID

amitchandak
Super User
Super User

@ResearchDev , if are looking for power bi, then we have hasonevalue https://p3adaptive.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors