Power BI change original table name which is displayed in Daxstudio - powerbi

I noticed very odd thing that Daxstudio allows you to view original table name. It is a bit niuanse because when you rename table created in M then Daxstudio still refers to it using original table name, not the new name. Here is how to reproduce the bug.
Power BI > Home > Enter Data
Name the table RedTable.
Run a query in Daxstudio:
EVALUATE
DISTINCT('RedTable'[Column1])
Now rename the table to BlueTable:
And run the query in Daxstudio for a new table name:
You can still see the original table name in the Query column of Server Timings.
Is there a way to change this original table name created with M?
I can add that this bug is applicable only to tables created with M (be it Enter Data or plug to Server). This bug is not reproducible with DAX tables. The DAX tables are updated after you change their name and actual (not original) name is display in Query column of Server Timings of Daxstudio.

This is not a problem of DAX Studio, even though we could try to fix it in DAX Studio. :)
Here is what happens: the Tabular model (used also by Power BI) has an ID for each object and then a Name. The ID is assigned by the Power BI and Visual Studio UI when you create an entity (table/column/...). Visual Studio shows the ID as a readonly property, whereas Power BI doesn't show that property at all.
The ID is used internally to reference the objects in the Tabular Object Model (TOM). It is also used to identify column in the interaction between Formula Engine and Storage Engine.
The Storage Engine queries captured by DAX Studio are messages intercepted with a debugging session connected to the Analysis Services session and in these messages the text represents entities (in particular table names) through their ID rather than through the Name property.
As Microsoft would say, this is "by design".
So far, DAX Studio simply capture the text of the storage engine queries and display this information.
However, DAX Studio "massages" the text, removing a lot of "noise" and making the query more readable. During this phase, it is possible to consider renaming IDs with Names.
I just created a feature request. That was easy. When to implement the feature, finding the time is much harder!

Related

Power Bi DAX Measure not recognizing columns

I recently changed my data source to an Azure SQL DB, I kept the column/table names and datatypes the exact same as previous for a smooth transition. However, for two of the tables the new columns are not recognized in the original DAX measures even though they are named the same, this is also causing issues in tabular editor and DAX studio.
I have worked through the ETL process and can't see any issues throughout, the only thing that seemed to work was changing the column name in power query to the exact same name. Any ideas if this is on the SQL side or an issue with Power Bi? 
I expected this to work without any issues.

Retrieve acolumn name from in underlying dataset (Before it got renamed in Power BI)

I'm trying to build a dynamic data dictionary for my Power BI data set. To do that, I am querying the DMVs in DAX studio to get the objects names and descriptions from the model directly.
Used query for the columns details:
SELECT * from $SYSTEM.TMSCHEMA_COLUMNS
However, when I run this query, I'm getting ExplicitName = SourceColumn. I had assumed that the SoruceColumn would contain the column name before any transformation in PowerQuery. Does anyone have any idea on how to get the original column name (the name of the column in the SQL Server DB per example)?
I have found a solution for this. You can find the technical column names in:
select * from $SYSTEM.DISCOVER_STORAGE_TABLE_COLUMNS where [COLUMN_TYPE] = 'BASIC_DATA'
If building this type of dynamic data dictionary interests anyone, do let me know. I can share the end result when I'm done.

In Power BI Desktop, how can I group all measures together (instead of placing under different tables)?

Tableau automatically groups measures together but Power BI Desktop doesn't natively support this. I find it annoying to have to place measures under imported tables as the measures don't really belong to those "parent tables" (and quite often take input from multiple tables — which one would you consider the "parent"?)
So I experimented with some workarounds and I'm sharing the successful (as of the date of this post) ones here:
Method 1 (recommended): "Model" view > "Enter data" to enter a manual data table. Give a name like "_Measures_" so it appears on top of tables, and keep only the default dummy column "Column". Create/move measures under it, then right click to delete that "Column". Now you're left with a blank table that groups those measures under it.
Method 2: "Data" view > "New table" to create a DAX calculated table. Rest the same as above, except that for a DAX calculated table you can't delete the dummy column but instead you can hide it.
You can also "Enter data" using Power Query Editor but I don't recommend going with that extra step -- workarounds are supposed to be quick (and dirty) anyways!
Final results look like this (note the difference of the icons):

making sql query dynamic based on slicer date

I am a new user of power bi and i wanted to know two things.
Is it possible to get data from mysql datasouce in real time based on query.
how to dynamically change the mysql query parameter based on slicer. e.g. if i have a query
select * from table name where date = 10/12/2019
than i want to change the date dynamically based on slicer visual
say in my slicer i have dates of different months and I select 12/01/2020 from slicer than the above query should act based on 12/01/2020 i.e select * from table name where date = 12/01/2020
How can i achieve this in power bi?
What you are looking for is called Direct Query, but that's not supported for MySQL data sources. (Datasource supported feature list)
You might be able to do some tricks on PowerBI Desktop using templates and ask for parameters first, then run a query. But that's not the proper usage of the functionality and you won't be able to use it anyway in the PowerBI Service (since you can't deploy a template). This also tends to be tricky and requires a good amount of manual work in M language (Power Query)
Summarizing, for your case I think the answer is no.

DAX studio showing additional (duplicate) local tables

My power Bi model contains the following tables:
However, when I connect to this model from DAX studio, I get the following:
Please note that all of these local date tables show the same metadata like the date table. Is this a potential problem? I believe this might be the reason behind this report working comparatively slow while development.
These tables show date tables automatically created by Power BI for all fields type "Date", to enable date hierarchy for them (year/quarter/month/day).
If you want to remove them, go to File/Options, then under "Current File" uncheck "Auto Date/Time":
These hidden tables will disappear. If you want to turn this feature off for all future/new files (I always do), uncheck a similar option under "Global".