How to join three tables with relationship using DAX only - powerbi

I need a help here. I have 3 datasets in power BI having relationships. Now, I have to use these power BI datasets in Power BI Report Builder. I need to join these three tables using DAX only in Power BI Report Builder. I am trying the below code but the code only works with two tables. How to join the 3rd table?
DAX query that does not work -
EVALUATE NATURALLEFTOUTERJOIN(
'PortalUser_SiteInformation',
'OverviewTrainingCompleted',
'CourseDetails'
)
The above code works if I remove 1 table from the above query.
Below is the screenshot of relationship between these tables:-
All 3 tables have relationship with column User_id. Below is the screenshot of Power BI Report Builder
I Know how to join tables in PowerQuery but I have only option to join in Power BI Report Builder. Please help me to join these three tables in DAX.
Thanks in Advance..

You need to check the requirements for the join conditions in DAX for NATURALLEFTOUTERJOIN():
It seems that Your Middle Table(PortalUser_Siteinformation) has a different column name than the other 2.
I recommend you to check full requirements(column names, data types, lineage etc.. ) of your tables involved.
And after fixing that, You can try this DAX Code:
EVALUATE
NATURALLEFTOUTERJOIN (
NATURALLEFTOUTERJOIN (
'PortalUser_SiteInformation',
'OverviewTrainingCompleted'
),
'CourseDetails'
)

Related

How to get 1 column in a table report filtered by a slicer not in sync with the table

I am a PowerBi beginner and would like to know if it is possible to create a table report that behaves like explained in the attached picture (according to the fact table I have).
I tried to do it with a DAX measure using the following formulas but it does not work as I wish :
CALCULATE(SUM('Fact'[Invoice]),'Fact'[Customer] = SELECTEDVALUE('Fact'[Customer]))
CALCULATE(SUMX('Fact','Fact'[Invoice]),'Fact'[Customer]=SELECTEDVALUE('Fact'[Customer]))
The slicer does not filter the table in order to get all the product in the table even if the customer did not buy one.
Is it possible to do it ?
Many thanks

new Power BI table combining unrelated data

I am trying to create a table that is a list of all possible combinations between two tables: products and companies. I'm building a dashboard in Power BI and the data comes from SQL queries. I have the following list structures for the Products table and the Companies table:
and my desired output for analysis is:
There is nothing that relates the companies to the products, and I'm trying to get a list of all of the products for each company. Can I do this in Power BI? If not, is it possible in SQL (there is nothing to join on)? Thank you for your help!
You can do this with a 'hacked' join, or a cross join. I prefer the former from a process POV, but cannot speak to speed or efficiency.
Using a Join ( Merge in PQ )
Create a new column 'DummyKey' with a value of 1 on each table.
Merge both tables using your 'DummyKey' columns.
Complete the Join process and choose the columns you want to bring through.
Cross Joins in PowerQuery according to MS
I think this 'cross join' is only technically right and does not provide future flexibility.
Both methods will get you to the same end point, and can be done in SQL or PQ.

Slicers showing all values - Power BI Desktop

I have a table in Power BI Desktop which has multiple columns (5 Dimension data connected with a Fact table - Star Schema).
I have now added 3 Slicer to filter data in above table but when I select the first slicer then the other slicers should show only available dimensions data but it is showing all the available data.
I tried changing Cross filter Direction to both from single in Manage Relationship but it works for only one column but not to all with the below error or warning message.
NOTE: I do have few more Pages in the same Visualization report which contains separate fact table with same dimension keys.
Please let me know how to resolve this or any other suggestions.
Use the following measure to filter through your dimensions
Cross Filter = INT( NOT( ISEMPTY( 'Your FACT TABLE') ) )
Then dragg this measure in every slicer into the filter pane and select the option is equal to 1.
My power bi version is in spanish but you will get the idea.
----------------------------------------

Power BI DAX | Multiple Slicers from Different DIM TABLES with Multiple ALLSELECTED DAX statements

Is there a way to to write ALLSELECTED DAX with multiple slicer values where slicers come from different Dim Tables?
Goal: A Table in Power BI where end users can select the external slicers filtering a table and see the sum cost based upon the 3 above mentioned external slicers. See picture below.
Example:
Slicer 1 has Project Name (DimProject[ProjectName])
Slicer 2 has Project Manager (DimTeam[ProjectManager])
Slicer 3 has Calendar Year & Month (DimDate[CalendarYearAndMonth])
I tried the following: CACULATE(SUM(COST), ALLSELECTED(DimProject[ProjectName]), ALLSELECTED(DimTeam[ProjectManager]), ALLSELECTED(DimDate[CalendarYearAndMonth]) )
It didn't work. Can anyone advise on what is the correct way to filter with multiple slicer values [from different tables] while using ALLSELECTED? Is there a better pattern I should be using?
Have a look at the TREATAS function
https://learn.microsoft.com/en-us/dax/treatas-function

how to move columns in one table to other table in power bi?

I want to move(denormalize)two tables into another tabe,how can I do it?
have two tables like:- 'sales by category','product by category',
I want to move these two tables into another table which is 'products'.
i tried Related function with calucated column and it won't work bcoz those tables sharing one-one relationship
plz solve my issue who are familiar with data modelling and dax in power bi
The best way is to use the merge function in power query, follow the tutorial on the below link it'll explain it better, this will allow you to join the tables you need into query, in turn creating a table in Power BI
https://learn.microsoft.com/en-us/power-bi/desktop-shape-and-combine-data#combine-queries