PowerQuery: Replace Value with Conditional if and the actual Date

Hello,
i have the following problem. I want to update the values of a column with following condition.
#"blabla" = Table.ReplaceValue(#"Table","DateValue1_month","DateValue2_month",Replacer.ReplaceValue,{"column"}),
but i have to check first
if
DateValue1_month < ActualMonth
then
DateValue1_month = ActualMonth
else
keep DateValue1_month
fi
Can some help me with this

I'm a little confused by the question because I can't tell whether DateValue1_month and DateValue2_month represent columns or values. If values, then I'm not sure why they would be quoted in the call to Table.ReplaceValue. Can you flesh out the problem a
little with more-concrete examples?
What I'm guessing is that you want to do something like "if the value in the column is less than ActualMonth then replace it with ActualMonth; otherwise, keep it unchanged." While this kind of operation can be done with Table.ReplaceValue, It's
not straightforward. The problem is that you need to split the logic between a custom replacer function and several literals. If this is what you want to do, I would use Table.TransformColumns and say
Transformed = Table.TransformColumns(table, {"column", each if _ < ActualMonth then ActualMonth else _})

Similar Messages

  • I have the iPad with retina display and the screen is cracked, however it is not yet a year old, how much does it cost to replace it

    I have the iPad with retina display and the screen is cracked, however it is not yet a year old, how much does it cost to replace it?

    I don't know what country that you are in, but in the US the price for repair (i.e. replacement) is (from here) $299 for the iPad 3, and  here in the UK (from here) £256.44

  • Help with Conditional Display and Validation

    Version 4.1.1.00.23
    Hello,
    I'm having a difficult time with a conditional display and validation I'm hoping someone can help with.
    Requirements:
    When the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox)
    If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL)
    What I've tried
    Create a Dynamic Action on the Start Date
    Event: Change
    Selection Type:Item(s)
    Items(s): P51_START_DATE
    Condition: none
    True Action Section:
    Action: Show
    Fire on Page Load: Checked
    Show all page items on the same line: No
    Affected Items Section:
    Selection Type:Item(s)
    Item(s): P51_CHANGE_REASON,P51_CHANGE_DESC
    I've also created a Dynamic Action with similar settings for the P51_END_DATE.
    I created a Validation for the P51_CHANGE_REASON as Function Returning Error Text:
    DECLARE
        v_start_date    work_items.start_date%TYPE;
        v_end_date      work_items.end_date%TYPE;
    BEGIN
        SELECT start_date
              ,end_date
        INTO   v_start_date
              ,v_end_date
        FROM   work_items
        WHERE  work_items_id = :P51_WORK_ITEMS_ID;
        IF ( (v_start_date != TO_DATE(:P51_START_DATE,'DD-MON-YYYY') OR v_end_date != TO_DATE(:P51_END_DATE,'DD-MON-YYYY') ) AND
              :P51_CHANGE_REASON IS NULL ) THEN
            RETURN 'Change Reason must have a value';
        END IF;
    END;
    The Issue
    I tried to create another Dynamic Action to hide the P51_CHANGE_REASON and P51_CHANGE_DESC fields on page load, but when either of the date fields are changed and the validation is fired the P51_CHANGE_REASON and P51_CHANGE_DESC are hidden again.
    There are two buttons to submit the page: 'SAVE' will submit the page and stay on the page and 'SAVE_CHANGES' will submit the page and branch to the previous page (which is a report with EDIT buttons to edit the record).
    I can't get the page load Dynamic Action to NOT fire when the validation is fired.
    I hope this is clear and if not what information can I provide?
    Thanks,
    Joe

    Phil,
    Thank you for looking at this.
    Yes if the Change Reason is NULL when the edit page is displayed then the Change Reason and Change Description fields are hidden. If the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox). If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL).
    The problem I'm having is that if no Change Reason is entered and the page is saved thereby firing the validation the Change Reason and Change Description fields are hidden again (because of the On-Load Dynamic Action to hide them). So now the user can't put in a Change Reason...unless they change one of the date fields again which isn't going to be accepted.
    Is there a way to determine if a validation error was fired and be able to use that on the On-Load Dynamic Action to hide the two fields? Something like...If the validation fired then don't run?
    Please let me know if I'm still confusing you.
    Thanks,
    Joe

  • My mac froze in an application so I shut it down by powering off with button, now when I try to turn it on I have a grey screen with Apple loge and the timer swirling but it doesn't get past this, please help!

    I Shut down my Mac by holding in the power button after my iMac froze and now when I try to turn it back it on all I get is the grey screen with Apple loge and the timer and doesn't get any further.  I have tried the diagnostic test but nothing was found.

    Take each of these steps that you haven't already tried. Stop when the problem is resolved.
    To restart an unresponsive computer, press and hold the power button for a few seconds until the power shuts off, then release, wait a few more seconds, and press it again briefly.
    Step 1
    The first step in dealing with a startup failure is to secure the data. If you want to preserve the contents of the startup drive, and you don't already have at least one current backup, you must try to back up now, before you do anything else. It may or may not be possible. If you don't care about the data that has changed since the last backup, you can skip this step.
    There are several ways to back up a Mac that is unable to start. You need an external hard drive to hold the backup data.
    a. Start up from the Recovery partition, or from a local Time Machine backup volume (option key at startup.) When the OS X Utilities screen appears, launch Disk Utility and follow the instructions in this support article, under “Instructions for backing up to an external hard disk via Disk Utility.” The article refers to starting up from a DVD, but the procedure in Recovery mode is the same. You don't need a DVD if you're running OS X 10.7 or later.
    b. If Step 1a fails because of disk errors, and no other Mac is available, then you may be able to salvage some of your files by copying them in the Finder. If you already have an external drive with OS X installed, start up from it. Otherwise, if you have Internet access, follow the instructions on this page to prepare the external drive and install OS X on it. You'll use the Recovery installer, rather than downloading it from the App Store.
    c. If you have access to a working Mac, and both it and the non-working Mac have FireWire or Thunderbolt ports, start the non-working Mac in target disk mode. Use the working Mac to copy the data to another drive. This technique won't work with USB, Ethernet, Wi-Fi, or Bluetooth.
    d. If the internal drive of the non-working Mac is user-replaceable, remove it and mount it in an external enclosure or drive dock. Use another Mac to copy the data.
    Step 2
    If the startup process stops at a blank gray screen with no Apple logo or spinning "daisy wheel," then the startup volume may be full. If you had previously seen warnings of low disk space, this is almost certainly the case. You might be able to start up in safe mode even though you can't start up normally. Otherwise, start up from an external drive, or else use the technique in Step 1b, 1c, or 1d to mount the internal drive and delete some files. According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation.
    Step 3
    Sometimes a startup failure can be resolved by resetting the NVRAM.
    Step 4
    If a desktop Mac hangs at a plain gray screen with a movable cursor, the keyboard may not be recognized. Press and hold the button on the side of an Apple wireless keyboard to make it discoverable. If need be, replace or recharge the batteries. If you're using a USB keyboard connected to a hub, connect it to a built-in port.
    Step 5
    If there's a built-in optical drive, a disc may be stuck in it. Follow these instructions to eject it.
    Step 6
    Press and hold the power button until the power shuts off. Disconnect all wired peripherals except those needed to start up, and remove all aftermarket expansion cards. Use a different keyboard and/or mouse, if those devices are wired. If you can start up now, one of the devices you disconnected, or a combination of them, is causing the problem. Finding out which one is a process of elimination.
    Step 7
    If you've started from an external storage device, make sure that the internal startup volume is selected in the Startup Disk pane of System Preferences.
    Start up in safe mode. Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Post for further instructions.
    Safe mode is much slower to start and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know the login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    When you start up in safe mode, it's normal to see a dark gray progress bar on a light gray background. If the progress bar gets stuck for more than a few minutes, or if the system shuts down automatically while the progress bar is displayed, the startup volume is corrupt and the drive is probably malfunctioning. In that case, go to Step 11. If you ever have another problem with the drive, replace it immediately.
    If you can start and log in in safe mode, empty the Trash, and then open the Finder Info window on the startup volume ("Macintosh HD," unless you gave it a different name.) Check that you have at least 9 GB of available space, as shown in the window. If you don't, copy as many files as necessary to another volume (not another folder on the same volume) and delete the originals. Deletion isn't complete until you empty the Trash again. Do this until the available space is more than 9 GB. Then restart as usual (i.e., not in safe mode.)
    If the startup process hangs again, the problem is likely caused by a third-party system modification that you installed. Post for further instructions.
    Step 8
    Launch Disk Utility in Recovery mode (see Step 1.) Select the startup volume, then run Repair Disk. If any problems are found, repeat until clear. If Disk Utility reports that the volume can't be repaired, the drive has malfunctioned and should be replaced. You might choose to tolerate one such malfunction in the life of the drive. In that case, erase the volume and restore from a backup. If the same thing ever happens again, replace the drive immediately.
    This is one of the rare situations in which you should also run Repair Permissions, ignoring the false warnings it may produce. Look for the line "Permissions repair complete" at the end of the output. Then restart as usual.
    Step 9
    If the startup device is an aftermarket SSD, it may need a firmware update and/or a forced "garbage collection." Instructions for doing this with a Crucial-branded SSD were posted here. Some of those instructions may apply to other brands of SSD, but you should check with the vendor's tech support.  
    Step 10
    Reinstall the OS. If the Mac was upgraded from an older version of OS X, you’ll need the Apple ID and password you used to upgrade.
    Step 11
    Do as in Step 9, but this time erase the startup volume in Disk Utility before installing. The system should automatically restart into the Setup Assistant. Follow the prompts to transfer the data from a Time Machine or other backup.
    Step 12
    This step applies only to models that have a logic-board ("PRAM") battery: all Mac Pro's and some others (not current models.) Both desktop and portable Macs used to have such a battery. The logic-board battery, if there is one, is separate from the main battery of a portable. A dead logic-board battery can cause a startup failure. Typically the failure will be preceded by loss of the settings for the startup disk and system clock. See the user manual for replacement instructions. You may have to take the machine to a service provider to have the battery replaced.
    Step 13
    If you get this far, you're probably dealing with a hardware fault. Make a "Genius" appointment at an Apple Store, or go to another authorized service provider.

  • I am using a mini display to hdmi with my macbook and the display works fine. However, the sound will only play iTunes such as music and movies but when i go online to watch movies on youtube it will not play any sound. Please help

    I am using a mini display to hdmi with my macbook and the display works fine. However, the sound will only play iTunes such as music and movies but when i go online to watch movies on youtube it will not play any sound. Please help

    HDCP maybe? Read this http://www.macnn.com/articles/08/11/26/displayport.drm.conflict/

  • Since you don't allow emails any more – I suspect because of the numerous complaints with your service and the way you treat people that you don't want documented, I am calling and I want this call recorded for future reference. I have been a long time fa

    Since you don’t allow emails any more – I suspect because of the numerous complaints with your service and the way you treat people that you don’t want documented, I am calling and I want this call recorded for future reference.
    I have been a long time faithful customer of vzw and although the past year I have been late on payments many times and really couldn’t afford your exorbitant prices for services lots of other companies offer sometimes three times cheaper than what you charge, I have hung in there trying my best to meet my obligations.
    This month has been no exception. You don’t know the background; the whole story of people’s lives. I know you could care less because all you care about is the profit-the money that comes in.
    I was told when I agreed to pay my bill on the third per the recorded message that I had 14 days to pay…you cut me off anyway. The phones are not the tissue; your suspending my service means I cannot work. I may lose my job…how do you justify that? In any case? The least you could do would be to keep 4986 on and cut the phones off. But no. You refuse to compromise and meet the basic needs of your customer. What does that say about your company? I tried to call back on three separate occasions to tell you I couldn’t pay because of unexpected expenses but couldn’t get out of the automated system…sadly couldn’t get to a real person which also speaks volumes to me.
    All this tells me this is a company I don’t wish to be affiliated with any more. As soon as I can, I will discontinue service with you…I know you could care less. I will honor the remaining portion of the contract but that’s it. You don’t deserve my business. I am a good, hardworking person who, at the sacrifice of myself and my needs, always pays her bills…albeit late at times. I realize others tell you stories and lies to justify themselves. That’s not me. If you knew what I had been through the last 7 yrs you would marvel that I am  still on my feet…don’t judge too quickly. You could be wrong…and in my eyes you are by doing this to me.
    God will see us through this extremely scary time of that I have no doubt. No thanks to your company and lack of understanding and mercy. I am doing the best I can. Sadly you are not.
    See I have choices. MANY choices of providers for services you offer. I don’t have to be treated like this. I don’t have to succumb to your coldness and callousness. I intend to choose better (and cheaper). If your company doesn’t get the “people factor” back you will be sorry.

    Problem here is you admit you cannot afford the service.
    And you want to blame Verizon for losing a job because you have no cell phone.
    If your job depends on that phone I would pay it on time every time if you need a job to pay your bill.
    No other service is going to treat you any different. And if you cannot afford Verizon's monthly invoice how are you going to afford new devices, activation fees, possible security deposits on any other cellular carrier? You can't.
    Also if you made an arraignment to pay and then decide you cannot do so, why should Verizon extend you service or credit, or why is it you want to use the service and data and not pay for it as agreed.
    Get a prepay phone. Its evident the cost is too high for you to afford on post pay.
    Good Luck

  • I have an iPhone and iPad. I would like to get my husband an iPhone. Are we able to sync all devices and share info with both iPhones and the iPad, using a single email address?

    I have an iPhone and iPad. I would like to get my husband an iPhone. Are we able to sync all devices and share info with both iPhones and the iPad, using a single email address?

    Thanks for that. He is one of the last holdouts in IT so an email address for him would just mean I have 2 to check so that is what I am trying to avoid as we move into retirement:)

  • The email address connected to an old itunes account is no longer active. Can't access music i bought many years ago with out it and the old password.

    the email address connected to an old itunes account is no longer active. Can't access music i bought many years ago with out it and the old password.

    neilfromvancouver wrote:
    the email address connected to an old itunes account
    Old iTunes account?
    You created a new iTunes account instead of updating the old account with new info?'
    Contact iTunes support.

  • I am able to see my ipod touch 5th geneneratio in find my iphone on icloud but it is showing offline.... i think its stolen but i have locked it with a passcode and the person who i suspect doesnt know it... i wana get it back what should i do??

    i am able to see my ipod touch 5th geneneration in find my iphone on icloud but it is showing offline.... i think its stolen but i have locked it with a passcode and the person who i suspect doesnt know it... i wana get it back what should i do??

    lost/stolen                                     
    No app on the iPod is required.                           
    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected, on a computer browser go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up or conbtinue to show off-line.
    - You can also wipe/erase the iPod and have the iPod play a sound via iCloud.
    iCloud: Erase your device
    iCloud: Use Lost Mode
    - If not shown/shown off, then you will have to use the old fashioned way, like if you lost a wallet or purse.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it unless you had iOS 7 on the device. With iOS 7, one has to enter the Apple ID and password to restore the device.
    - Apple will do nothing without a court order                                               
    Reporting a lost or stolen Apple product                                              
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • With iOs 7 and the iPhone can someone use the phone while also using a communication app such as Speak It or Assistive Chat? These are text to speech systems for people who cannot speak well. Thanks you!

    With ios 7 and the iPhone can someone use their phone while also using a text to speech app, such as Speak It or Assistive Chat? These apps are used by people who have difficulty with speech production.
    Thank you.

    My iPhone 5 wouldn't start after I turned it off a few minutes after writing this. It went into recovery mode and I had no choice but to connect to iTunes on PC and restore.
    I restored to factory setting first, just to validate my phone was okay. For a second consecutive iOS update, the  iPhone 5 did not update smoothly while connected to PC and iTunes - I had to retry two times before the progress bar for the update showed. (The exact same problem with the restart occured when I updated to 7.0.4.)
    The good news is that I was ultimately able to restore the iPhone 5 to factory settings while running iOS 7.0.6. I did have a backup from about a month ago lying around and was able to successfully restore with that as well, so the damage done is almost negligible since I had my contacts, notes, mail, etc. backed up to iCloud.
    Once I completed both restores, the sync with iTunes worked fine.

  • I have a MacBook Pro 15" and my warranty just ran out! I partitioned my harddrive into two partitions, one with Snow Leopard and the other with microsoft.This morning I turned on my Macbook Pro and it will not boot into Snow Leopard.

    Good Morning,
    I have a MacBook Pro 15" and my warranty just ran out! I partitioned my harddrive into two partitions, one with Snow Leopard and the other with microsoft.This morning I turned on my Macbook Pro and it will not boot into Snow Leopard. I shut it off took out the battery, reinstalled the battery. Then I put in the Snow Leopard CD and booted up to disk utility and The Snow Leopard partion would not show up?? I do see the microsoft partion.
    I also rebooted holding down the shift key and still no Snow Leopard
    Could you please tell me what I can do, what keys do I press on restart any advice to get Snow leopard back.
    thank you.

    Have you restarted holding down the Opt key?  That procedure should give you a gray screen with all of the partitions that exist.  Then select the SL partition for boot.  Also go to System Preferences and Startup Disk, unlock the lock and select the SL partition as the default boot partition, then relock.

  • My iphone4 is stuck in restore mode with usb plug and the itunes symbol on the screen.

    My iphone4 is stuck in restore mode with usb plug and the itunes symbol on the screen after update os7 to os7.04
    My phone is completely disabled, what can i do ?

    Connect to iTunes. The phone is in Recovery mode. Follow the directions in this support document. http://support.apple.com/kb/HT1808

  • I have an IPone 4, there is an add video for Capital one that keeps coming up on its own... ive deleted my history and cookies and this video keeps taking over my phone. how do i get rid of it? the video is of a man with a puppet and the puppet is singing

    i have an IPone 4, there is an add video for Capital one that keeps coming up on its own... ive deleted my history and cookies and this video keeps taking over my phone. how do i get rid of it? the video is of a man with a puppet and the puppet is singing a song while he is checking his phone. how do i get rid of it????

    If it happens again the make sure that you aren't suppressing website colors.
    Make sure that you allow pages to choose their colors and that you haven't enabled High Contrast in the Accessibility settings.
    *Tools > Options > Content : Fonts & Colors > Colors : [X] "Allow pages to choose their own colors, instead of my selections above"
    *https://support.mozilla.org/kb/Options+window+-+Content+panel
    *http://kb.mozillazine.org/Website_colors_are_wrong
    *http://kb.mozillazine.org/Websites_look_wrong

  • I'm on OS X 10.6.8 and have a .mov file which plays on QuickTime 10.0 but with choppy video and the sound is out of sync???? File details are Video Codec: DNxHD (AVdn) Resolution 1920x1080 Audio Codec: PCM S24 BE (in24) Bitrate: 1536kb/s Solutions?

    I'm on OS X 10.6.8 and have a .mov file which plays on QuickTime 10.0 but with choppy video and the sound is out of sync???? File details are Video Codec: DNxHD (AVdn) Resolution 1920x1080 Audio Codec: PCM S24 BE (in24) Bitrate: 1536kb/s.  Any ideas?

    Question: Is all the source footage shot in 16 bit audio or is some also shot in 12 bit?
    http://docs.info.apple.com/article.html?artnum=42973
    http://www.kenstone.net/fcphomepage/idvd_6stone.html
    http://docs.info.apple.com/article.html?artnum=93006
    http://docs.info.apple.com/article.html?artnum=303550
    http://docs.info.apple.com/article.html?path=iDVD/6.0/en/397.html
    http://docs.info.apple.com/article.html?artnum=61636
    http://docs.info.apple.com/article.html?artnum=302925

  • I used Roxio VHS to DVD for Mac (have iMac with Snow Leopard) and the audio does not synch with the video when playing in iMovie.  Any suggestions to fix?

    I used Roxio VHS to DVD for Mac (have iMac with Snow Leopard) and the audio does not synch with the video when playing in iMovie.  Any suggestions to fix?

    Thanks for the reply.  I tried playing with detaching the audio in iMovie, but with 20+ hours of video to correct, it would take too long.  After 28 hours, Corel/Roxio tech support replied that it is a known bitrate mismatch problem and they have no real fix.  I strongly suggest not to buy this product.

Maybe you are looking for