DAX studio showing additional (duplicate) local tables - powerbi

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".

Related

How to prevent access to SSAS through visual studio?

I have a typical fact table with dimensions Project, Profit Center, etc
In a report, I have a table visual that shows individual numbers; and another table shows the department numbers…
It looks something like this:
(Left: personal numbers. Right: department numbers)
My goal is that Tim shouldn’t be able to see someone else’s number, but he definitely can (and should) see the aggregated numbers for his department.
I realized that someone accessing from PowerBI or excel can connect to the model and play with the tables, pick another name and see someone else’s number, therefore I have hidden most tables...
But now, I just realized, someone with access can connect from Visual Studio to the SSAS:
The person can open the .bim, unhide all tables, and with the “analyze from excel” option in VS see any numbers…
Is there any way to avoid/prevent this?
More info:
My model:
(Project table has columns Lead1,Lead2,Lead3,Lead4,Lead5 and Lead6… Engagement Role is just an unpivot of this).
On my left visual I have:
(triggering a more restrictive access).
My RLS:
Is there any way to avoid/prevent this?
RLS will be enforced from every client experience, but RLS is never enforced for Workspace members with higher than Viewer permissions. See Using RLS with workspaces in Power BI
And hiding tables and columns is not a security measure. Hidden tables and columns can be used in DAX queries and measures.

Is there a fast way to see all the active mesures in a Power BI report?

I am trying to siff through a large PBI report and for that I want to be able to determine the active measures and tables in the data model. In others words, I wanna be able to see what's being used from what's unused or obsolete in the model.
Is there, by any chance, a shortcut for that?
Thanks in advance
I think what you are after is RADACAD's amazing PowerBI Helper Utility.
This utility, once installed, is integrated in to the PowerBI external tools ribbon.
See the section at the link above around removing unused fields and measures.
Remove Not-used fields If there is a field not used in any visual, filter, or other calculations, then this is a safe field to be
removed. Power BI Help can identify these fields even if they are DAX
calculated columns or measures. Using the dependency tree of the
measure, it will identify if the field is used in another calculation
that is used in a visual or filter.

Power BI change original table name which is displayed in Daxstudio

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!

How can I get a mapped value from a many-to-one related table via Power BI DirectQuery?

I have 2 tables that share a Foreign Key. Power BI sees them as a Many (Table A) to One (Table B) relationship. All I'm trying to do is to get a value from Table B to show up as a column for Table A.
When I look at the table via PowerQuery (using "Edit Query" in Power Bi Desktop) I can see Table B but every row just shows "Value" as it's value. If I click "Value" I get the details of the related object below the table so I know the relationship works.
My struggle is that none of the methods I've seen via google results to get that value work for me.
I've tried using LOOKUPVALUE and RELATED.
RELATED(TableB[ColumnNameImTryingToRetrieve])
RELATED(TableB[IdColumn]
For the RELATED function, every variation I try for the ColumnName parameter either results in the error message
"The column 'TableB[NameIveGiven]' either doesn't exist or doesn't
have a relationship to any table available in the current context."
or the error message
"Parameter is not the correct type".
LOOKUPVALUE isn't even available as an option in the Intellisense options that come up so i can't try it.
I've seen a lot of references about LOOKUPVALUE not being available in DirectQuery mode and that there used to be an option in DirectQuery options called "Allow unrestricted measures in DirectQuery mode" but that is no longer available. This supposedly would have allowed LOOKUPVALUE to work.
Also, when I make most changes in PowerQuery when trying to add the new column I get the error message "This step results in a query that is not supported in DirectQuery mode".
Is there any simple way to get the value I'm after in DirectQuery mode or should I switch to Import Mode?
Okay, I got what I was after. I used "Merge Queries" in Power Query Editor to do a Left Join on the tables. Then I split the table column up that was created by the Join and left only the column I was after.
Then in a third table, I was able to to do:
RELATED(TableA[TableB.1.ColumnINeed])

Get "not allowed for columns on the one side of a many-to-one relationship" errors

i have created Power bi project, It is working fine in the beginning but when i refresh my datasource , i get this error " not allowed for columns on the one side of a many-to-one relationship" . Any can help me ??
I resolved this issue by going into the relationship, right clicking to view properties,
and making it a Many to One Relationship.
Power BI sometimes automatically creates relationships between the queries that are being used to drive the data in the reports. When I have encountered this error or errors like it in the past I:
Go into Manage Relationships
Verify that there is a relationship listed
Evaluate the From and To relationships that are listed as active
Delete any invalid From and To relationships between separate data sets
My most common issue in the past has been that I will have two very different queries pulling data from separate sources with similar column names and Power BI will generate a relationship between them that is invalid. After removing the relationship it has always resolved my issue.
In my case issue was related to the fact that Power BI was threating "SQL View" as a "Table" and as a result it was creating relations for it.
Although I've checked the "Manage Relationships":
and removed one relation which was not reasonable the issue was still persisting.
Then issue solved when I had looked in the "Relations"
tab and found unreasonable relations related to my View and removed them.
None of these answers helped me. For me I received this error when trying to refresh my dataset which had previously worked for some time. After investigating I found the schema of the source database had changed. Two fields that previously didn't allow nulls now allowed nulls and had null values for some rows. My Power BI model still expected these fields not to contain nulls but was throwing this same and very misleading error:
Data source error: Column 'x' in Table 'y' contains blank values and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table. Table: y.
Initially on seeing this error and opening up my report in PowerBI Desktop and going to Modeling > Manage relationships. I looked for a relationship on table y for column x, but no such relationship existed!? Was I confused? You bet.
After investigating further I discovered the database schema change and resolved by updating my Power BI model by going to the data model editor, expanding table y in the Fields panel on the right hand side, selected field x, expanded "Advanced" in the Properties panel and changed "Is nullable" from No to Yes. I then applied the changes, saved the report and refreshed the dataset.
I followed these steps
Step 1: Go to the Model section from the left side of the Power BI Desktop
Step 2: Delete all the relationships (or connections) amongst the tables that have been created by Power BI itself while you were working with the Power Query Editor
Step 3: Click 'Refresh visual and data' option in Home (besides the Transform Data button)
It worked and loaded the new data and also applied the automations done in the query editor.
I got this error on a completely new table made in Power Query, weird since I had no chance to create a relation yet.
Easy fix: Apply a filter that removes all blanks on that column - apply the filter, and then delete this new filter again
Another problem you might have is that "Autodetect new relationships" is turned on:
This is a setting that disables auto-detecting relations under "File/Options & settings/Options/Current File/Data Load/Relationship/Autodetect new relationships after data is loaded"
I had the same issue, after spending hours of searching for a fix and not finding anything, I started scratching around and found the problem took 1second to fix. My issue specifically, was a an additional relationship created within the model. The connection showed up as a "dotted" line one of my tables. I deleted the relationship, refreshed. Done.
This happens when your table or connected tables in excel, contain blank row, for resolving this issue you will need to click anywhere in the excel table, then click on the table tools, then resize table and Select the entire range of cells to include all rows, make sure no blank rows are included then save and get back to your PowerBI then again refresh it, all will work.