Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I know Power Query does not offer the ability to direcctly add Form Controls, but is there another work around to add in checkboxes?
I wrote a query to pull orders for each day. The user wants to be able to check off the order if it was actually received for that day and to show what day and time they checked off the order. I am not sure if I could write a VBA code to add in the checkboxes for each line item and the time stamps once it has been checked off. I am not that familiar with VBA, but I have seen things on how to add that in. However, I am not sure if the VBA code will be in sync with my query when I refresh it because the new orders will populate and old orders will fall off.
Below is what I would like my table to look like:
ID | Description | Order Date | Order Expected Date | Received? | |
1 | Apples | 3/25/25 | 4/20/25 | X | 4/20/25 16:45 |
2 | Oranges | 2/10/25 | 4/20/25 | X | 4/20/25 16:45 |
3 | Lemons | 2/15/25 | 4/30/25 | ||
4 | Limes | 4/01/25 | 5/1/25 | X | 4/20/25 16:45 |
FYI: The user will be utilizing this table in Excel not in PowerBI.
Any help, advice, or other suggestions would be greatly appreciated! Thanks!
Solved! Go to Solution.
Hi @dolphin18 You could do this by combining Power Query and VBA. Use Power Query to generate the table and VBA to add checkboxes in the "Received?" column. Write a macro to insert checkboxes for each row and another to record timestamps when checkboxes are checked. After refreshing the table in Power Query, re-run the VBA macro to realign the checkboxes.
Hi @dolphin18,
Thank you for reaching out to the Microsoft Fabric Forum Community.
Thank you @Akash_Varuna, for your insights.
As an alternative to using checkboxes and VBA, I’d like to suggest a more data-driven approach if your source data includes a field that indicates whether an order has been received (for example, a "Received Date" or "Status" column).
Instead of using manual checkboxes, you can handle the "Received" status directly in Power Query by adding a custom column that evaluates this field. For instance, using a conditional statement, you can flag orders as received (1) or not received (0).
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Hi @dolphin18 You could do this by combining Power Query and VBA. Use Power Query to generate the table and VBA to add checkboxes in the "Received?" column. Write a macro to insert checkboxes for each row and another to record timestamps when checkboxes are checked. After refreshing the table in Power Query, re-run the VBA macro to realign the checkboxes.
Hi @Akash_Varuna, thank you for the suggestion! I was able to do as you said and got both to work together. However, when I uncheck a box, the timestamp will stay in the column next to the checkbox. Do you know how the timestamp can be removed when I uncheck a box?
@dolphin18 you can modify the VBA macro to include a condition that clears the timestamp cell if the checkbox is unchecked
Thank you! I added a condition and it is working now!