Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
dmilardo_au
Frequent Visitor

SQL join in Power Bi with DAX

I want to create a table  like in the picture below. Same rows of table A and B should't be in the new table.

dmilardo_au_0-1686576767682.png

 

4 REPLIES 4
dmilardo_au
Frequent Visitor

Sorry, but that's not what I meant. I try to describe it in a other way.

I want to realise a SQL join of two tables with DAX.

I have two tables, tabel A and B. Both have the same columns-structure.

 

Some of the rows of table B can be found in table A. 

I want to get a new table that has all the rows of table A minus the rows that can be found in table B.

 

Like in the picture of the first post to see, i only want the red part in my new table.

dmilardo_au_0-1686732902957.png

 

dmilardo_au
Frequent Visitor

I need to create legend for a dot-plot. 

I have a table with columns: rivet_points | result_id | machine_classification | ....

One rivet_point can have multible result_id's.

My database gives every result_id a machine_classification (0 or 1) and I need for every last id of every rivet_point a new machine_classification (for example 2).

So that I can colour the dot-plot with machine_classification and get to see the last result_id's.

 

At the moment I have a table with all last result_id's. But if I create a new table with the function UNION I get dublicates of all the rows with these result_id's.

 

Table "last_results" with all last result_id's to every rivet_point:

last_results =
ADDCOLUMNS (
    SUMMARIZE ( result, result[rivet_points]),
    "result_id", CALCULATE ( MAX ( result[result_id] ) )
)
("result_id", "result_id" and mc are inplemnted by hand)

dmilardo_au_0-1686578402448.png

 

I wanted to creste a seprate table in which all the last result_id's don't exist so I can use the function UNION again and get a table in which these result_id's have a different machine_classificaton.

 

 @dmilardo_au 

Am not sure to understand your model, but are trying to add a column(result_id) to your Summarized table and you want to select the Null Value of machine_classification !

If so then I think you need to add a filter context to your CALCULATE ( MAX ( result[result_id] ) ) by machine_classification = 0

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

aj1973
Community Champion
Community Champion

Hi @dmilardo_au 

You need to be more precise in your thread, but in Power Query you can achieve that 

aj1973_0-1686577185700.png

Use Merge Queries.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.