Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

49
1 © 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com MURRAY FIFE DYNAMICS AX 2012 TIPS & TRICKS EMBED POWER BI Q&A INTO YOUR MENU SO YOU CAN ASK FOR REPORTS

Transcript of Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

Page 1: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

1

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

MURRAY FIFE

DYNAMICS AX 2012 TIPS & TRICKS

EMBED POWER BI Q&A INTO YOUR MENU SO YOU CAN ASK FOR REPORTS

Page 2: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Page 3: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

EMBED POWER BI Q&A INTO YOUR MENU SO YOU CAN ASK

FOR REPORTS

BY MURRAY FIFE

Page 4: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Copyright © 2014 Murray Fife

All Rights Reserved

Page 5: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

What You Need For This Guide

All the examples shown in this blueprint were done with the Microsoft Dynamics AX 2012 virtual machine image that was downloaded from the Microsoft CustomerSource or PartnerSource site. If you don't have your own installation of Microsoft Dynamics AX 2012, you can also use the images found on the Microsoft Learning Download Center or deployed through Lifecycle Services. The following list of software from the virtual image was leveraged within this guide:

• Microsoft Dynamics AX 2012 R3

Even though all the preceding software was used during the development and testing of the recipes in this book, they may also work on earlier versions of the software with minor tweaks and adjustments, and should also work on later versions without any changes.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by emailing [email protected].

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a l ink to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at [email protected] if you are having a problem with any aspect of the book, and we will do our best to address it.

Preface

Page 6: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

6

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Page 7: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

7

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Embed Power BI Q&A Into Your

Menu So You Can Ask For

Reports

One of the coolest features within the Office 365 Power BI suite is the Q&A function where you can type in questions about the data and it will translate it into a query and then show you a report of the results. By linking this with your Dynamics AX data, even the most un-technical person should be able to become their own report writer. If you want to take this to the next level and make it even more accessible to the users then you may want to do a little bit of coding and add it directly to the users menus so that they can just click on the link and go straight to the Q&A page without even having to know the URL for Office 365.

It is like having your own personal data guru at your beck and call.

Page 8: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

8

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

The first thing that you need to do is access your Power BI Q&A site so that you can get the initial URL that you want to link to the menu.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 9: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

9

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

After you know what you want to link to, you can start adding the menu item. And in order to do that we need to create a form that will be the website wrapper that we can then within the client. To do this, open up AOT and expand out the Forms group.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 10: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

10

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then right-mouse-click on the Forms group and select the New Form from the context menu.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 11: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

11

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

After you have done that you should have a generic Form control.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 12: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

12

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Change the Name property of the Form to PowerBIQA.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 13: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

13

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then expand out the PowerBIQA form and the further expand the Design node.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 14: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

14

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Right-mouse-click on the Design node, click on the New Control menu item and then select the ActiveX item.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 15: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

15

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will open up the ActiveX browser and you should be able to find the Microsoft Web Browser control and click on the OK button.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 16: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

16

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will add the control to the Design for us.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 17: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

17

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Select the ActiveX control and change the Name property to PowerBIQA so that it is less generic.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 18: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

18

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then set the Width property to Column Width so that it takes up all of the horizontal space in the design.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 19: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

19

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

And also set the Height property to Column Height so that it takes up all of the vertical space in the design.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 20: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

20

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then select the Design node and change the Window Type property to Content Page –this will allow us later on to embed the form directly within the client.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 21: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

21

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Now we need to tell the browser to navigate to the PowerBI website when it opens. To do this, right-click on the Methods group for the PowerBIQA form, select the Override Method menu item and select the Activate method.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 22: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

22

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will open up the code editor for the method.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 23: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

23

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Add the following line of code to the activate() method:

PowerBIQA.Navigate(“Your PowerBI URL”);

And then close the editor.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 24: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

24

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

When you return to AOT, right-mouse-click on the PowerBIQA form and select the Open option.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 25: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

25

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This should open up a form and show you the Power BI Q&A page.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 26: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

26

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Now we need to add this form to the menu. To do this we first need to create a menu item that points to the form. To do this, expand out the Menu Items node within AOT and then expand out the Design node.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 27: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

27

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Right-mouse-click on the Design node and select the New Menu Itemmenu item.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 28: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

28

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will create a new Menu Item control.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 29: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

29

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Change the Name property of the menu item to PowerBIOpenQA and also change the Label and Help Text properties.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 30: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

30

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Select the drop-down for the Object property, and you should be able to find the new form that you just created.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 31: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

31

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

After you have done that you can save your changes (CRTL+S) and then right-mouse-click on your new menu item control and select the Open menu item.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 32: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

32

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This should open up the form again for you.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 33: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

33

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

The final step is for us to add the menu item to the menu itself. To do that expand out the Menus node and you will see all of the main menus in the system.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 34: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

34

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Expand out the main that you want to add the menu item to - in our case it’s the SalesAndMarketingmenu.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 35: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

35

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Then right-mouse click on the group that you want to add it to – which we chose the Reports folder –and select the New menu item and then the Menu itemsub-menu item.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 36: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

36

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

This will add a new menu item control to the menu.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 37: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

37

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

All you have to do here is select the Menu Item that you just created from the dropdown within the MenuItemNameproperty.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 38: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

38

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

And one last tweak is to set the IsDisplayedInContentArea property to Yes so that it is embedded within the client rather than a separate form.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 39: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

39

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Now just save the changes (CTRL+S) and exit and restart the Dynamics AX client.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 40: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

40

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Now when you open up your menu you will see a new menu item for Power Q&A.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 41: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

41

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Clicking on it will take you straight to the Power BI Q&A page.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 42: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

42

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Once you start asking questions, you can refine your answer…

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 43: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

43

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

And then filter out to particular records…

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 44: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

44

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

And then even compare and contrast multiple sets of data.

Now that is super cool.

Embed Power BI Q&A Into Your Menu So You Can Ask For Reports

Page 45: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

45

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Page 46: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

46

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Page 47: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

47

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

The Tips & Tricks series is a compilation of all the cool things that I have found that you can do within Dynamics AX, and are also the basis for my Tips & Tricks presentations that I have been giving for the AXUG, and online. Unfortunately book page size restrictions mean that I can only fit 50 tips & tricks per book, but I will create new volumes every time I reach the 50 Tip mark. If you want to view all of the compilations then here are the links.

50 Tips & Tricks For Dynamics AX 2012http://www.amazon.com/dp/1495487776/

Another 50 Tips & Tricks for Dynamics AXhttp://www.amazon.com/dp/1497383412/

Want More Tips & Tricks

Page 48: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

48

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Page 49: Embed Power BI Q&A Into Your Menu So You Can Ask For Reports Within Dynamics AX

49

TIP & TRICKS FOR DYNAMICS AX 2012

© 2014 Murray Fife, All Rights Reserved www.dynamicsaxcompanions.com

Murray Fife is a Microsoft Dynamics AX MVP, and Author with over 20 years of experience in the software industry.

Like most people in this industry he has paid his dues as a developer, an implementation consultant, a trainer, and now spend most of his days working with companies solving their problems with the Microsoft suite of products, specializing in the Dynamics® AX solutions.

EMAIL [email protected]

TWITTER @murrayfife

SKYPE murrayfife

AMAZON www.amazon.com/author/murrayfife

WEB www.dynamicsaxcompanions.com

About the Author