Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code snippets #447

Open
rudzimj opened this issue Oct 28, 2020 · 8 comments
Open

Code snippets #447

rudzimj opened this issue Oct 28, 2020 · 8 comments
Labels
idea ideas for new features

Comments

@rudzimj
Copy link

rudzimj commented Oct 28, 2020

Idea for new feature:

One of the things I love about DAX Studio is the Functions and DMV panes that help writing queries. I don't have to open files or switch tabs. The sample code is right there. It would be great to have the ability to have my own code snippets in another pane.

Two areas in particular where that would be helpful:
1) Sample EVALUATE code. I'm not great at writing EVALUATE statements. I don't do it except in DAX Studio to peek at tables. I have the samples from https://www.red-gate.com/simple-talk/sql/reporting-services/using-dax-to-retrieve-tabular-data/ in a OneNote, but would love to have it within DAX Studio.

2) Sample DMV queries. I love getting the DMV table names for a SELECT * query, but I also have customized queries like the one below to return the row counts in my tables. It would be great to pull this from a snippet pane rather than having to open a .DAX file.
SELECT DISTINCT
[CATALOG_NAME] as [Database],
DIMENSION_CAPTION AS [Table],
FORMAT(DIMENSION_CARDINALITY,'###,###,###') AS [RowCount]
FROM $system.MDSchema_Dimensions
WHERE DIMENSION_CAPTION <> 'Measures' --table name
AND CUBE_NAME = 'Model'
ORDER BY DIMENSION_CARDINALITY DESC --RowCount
--ORDER BY [DIMENSION_CAPTION] ASC --Table name

@dgosbell
Copy link
Contributor

Thanks for logging this idea. It's probably not too tricky to implement something like this, but I'm not overly sure how widely it would be used.

There are some other features we have that might address your 2 use cases already.

For Example EVALUATE code - the issue is that any examples would be specific to a single data model. Have you had a look at the new Query Builder feature? This is currently a preview feature so you have to enable it in the Advanced tab in Options, but you can drag and drop columns and measures to build up a query and you can either run it directly or you can output the query to the edit pane where you can customize it further.

For Sample DMV queries - these are probably more generic, but I tend to use the View Metrics option on the Advanced tab to get things like table and column cardinalities. We've added most of the key information you might need about a data model in there. Are there items missing from there? Or does it take too long and collect too much information if you just want some row counts?

@dgosbell dgosbell added the idea ideas for new features label Dec 15, 2020
@rudzimj
Copy link
Author

rudzimj commented Dec 18, 2020

These features are awesome. I love the Query Builder. Most of the EVALUATE statements I do are very simple, and the Query Builder handles it well.

I need to dive into the View Metrics a little deeper to see if that covers everything, but at first glance, it will cover a lot. If the numbers are right, I have some issues to check into with our "DAX" tables in our SSAS models!
image

Thanks for the feedback.

@marcosqlbi
Copy link
Contributor

You can see more details exporting the metrics in a VPAX file you can open with VertiPaq Analyzer: https://www.sqlbi.com/tools/vertipaq-analyzer/
You can find more videos explaining how it works in this free video course: https://www.sqlbi.com/p/dax-tools-video-course/

@rudzimj
Copy link
Author

rudzimj commented Dec 21, 2020

@marcosqlbi The VertiPaq Analyzer ribbon isn't showing up for me in v2.00. I tried opening the file with Macro Security enabled and no difference.

@marcosqlbi
Copy link
Contributor

Not sure this is the right area for discussing the Excel file for VertiPaq Analyzer - you can use comments at https://www.sqlbi.com/tools/vertipaq-analyzer/

However, what is the version of Excel that you are using? Do you see any warning/message displayed by Excel? Did you try on a different PC (maybe you have some other security options enable, such as aggressive antivirus or domain policies).

@dgosbell dgosbell mentioned this issue Jul 8, 2021
@mathewrtaylor
Copy link

nalyzer ribbon isn't showing up for me in v2.00. I t

I am using 2.10, and have no ribbon. There are no options for me to add in the developer tab (excel add ins) either.

@dgosbell
Copy link
Contributor

@mathewrtaylor - so the ribbon we were talking about in this thread is the one created by the Vertipaq Analyzer Excel file, not the add-ins ribbon where DAX Studio creates it's button. And v2.10 is over 2 years old. I suggest you try installing the current release and if you are still have trouble with the Excel add in then raise a new issue.

@mathewrtaylor
Copy link

mathewrtaylor commented Jan 20, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea ideas for new features
Projects
None yet
Development

No branches or pull requests

4 participants