![]() I started by bugging Daniel on the Tabular Editor 3 Issues forum on github where he gave me some tips. So how can we encapsulate all of that in the same place? This is something that you’ll face every time you create a calc group (or a table, or a measure etc). And you don’t want the C# error freaking out your potential users (or people who are looking while you execute your own macro). But either way, maybe that name is invalid because there’s already another table with that name. ![]() But then what to do you with names? It’s good to have default names for the things you want to create, but also leave the opportunity to modify the name if the user prefers a different name. I want my scripts to be «one-click compliant», that is, there is no configuration done on the code itself, it can be stored as a macro and any configuration happens on runtime through dialogs. Something as basic as the name of the calc group needs some thought. Something as basic as creating a calculation group, certainly can be more sophisticated than the basic function of the TOMWrapper. Well, the need to encapsulate logic in functions is there. Could we replicate something like that for Power BI? Something as basic as opening a workbook can be made much more functional if you add options such as check if the file is already open, or open it but hidden, or open it in a hidden instance with macros disabled, and in any case if anything goes wrong give me a nice error message and not the VBA screen that freaks out users. However, I felt that the programming I was doing was far away from what I used to do in VBA, where I had my functions which I could keep extending forever with further functionality. I was so happy when I started doing scripts to industrialize calculation groups and other little things (but basically calc groups). It went together with an add-in toolbar that gave me super-powers to do stuff, and the ability to modify it anytime as I had the code behind it.įast forward a few years, and I’m now all-in Power BI, loving it but also hating doing stuff manually over and over again. While this took some time to set up, it later sped up my development times so much that I still use the approach every time I need to do almost anything in excel. I started barely knowing how to write macros, but by the 4th year or so I had developed some code management tool in which I could load and publish (to a network folder, no real git or anything) code modules from any file. To bring some context to this post, I have a Excel+VBA background, working basically in excel and vba for like 7-8 years. So, today I’ll share how I’m starting to move my scripting to the next level, creating a custom DLL for Tabular Editor C# Scripts (never did that before!) and making use of intellisense by moving development (or at least the bulk of code typing) to Visual studio.įirst of all, great shoutout to Daniel Otykier and Xavi Paterna for bearing with me and my lack of C# expertise, and helping me put the pieces together. Maybe not tons, but certainly lots.īut anyway, once you get going with Tabular Editor C# scripts (now we need to specify if we are talking c# or DAX scripts) you may feel that you are repeating code, and as in any kind of programming, that’s not just a waste of time, it’s bad practice. ![]() Always copy from someone and build from there (that’s what I did!) - there are lots of great scripts out there. If you do, don’t start with a blank sheet. Then it’s time to bit the bullet and get your hands dirty with Tabular Editor scripts. Is no secret that if you work daily with Power BI, you should be using Tabular Editor, but if you are working with lots of different datasets you probably feel like you are doing the same thing over and over again.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |