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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
krimionn23
New Member

how to show a line in an array where the relationship between 2 tables is empty

Hi,

 

My problem :

  • I have 2 tables for example like this

Table 1 :

KeyName
AMike
BAlexander
CRebecca

 

Table 2 :

KeyValueDate
A10May 2024
A20Jul 2024
B30Jan 2024

 

The relationship between table 1 and 2 is on the key value

 

In Power BI, i create this array

KeySum Value
A30
B30

 

But i want to have this :

KeySum Value
A30
B30
C0

 

C doesn t show cause is not on the table 2. But how to have the C on the array without merge in power query the 2 tables ?

1 ACCEPTED SOLUTION

Hi @krimionn23 

Follow the following steps and compare your results as shown in the screenshots.

1- Create a dummy measure

DummyMeasure = 0

2- Create a second measure to sum the Value in the second table, adding the DummyMeasure as well.

 

M2 = 
 CALCULATE(
    SUM('Table'[VALUE]) +[Measure],
    CROSSFILTER('Table'[KEY], TBL1_1[KEY], Both)
 )

you will get the desired output as shown below. 

Musadev_0-1711470485202.png

Did I answer your question? Mark my Post as Solution. Thanks

 

 

 

 

 

 

View solution in original post

3 REPLIES 3
Musadev
Resolver III
Resolver III

hi @krimionn23 
You can achieve the desired results in multiple ways.
1- Merging the existing tables into a new table

2- Left outer join to append the empty rows

3- change the context of your filter and add the keys from table 1 to the visual. 

This 3 solutions or only 1 solution with 3 steps ? I need a solution without a merge between 2 tables , Only with the data model

Hi @krimionn23 

Follow the following steps and compare your results as shown in the screenshots.

1- Create a dummy measure

DummyMeasure = 0

2- Create a second measure to sum the Value in the second table, adding the DummyMeasure as well.

 

M2 = 
 CALCULATE(
    SUM('Table'[VALUE]) +[Measure],
    CROSSFILTER('Table'[KEY], TBL1_1[KEY], Both)
 )

you will get the desired output as shown below. 

Musadev_0-1711470485202.png

Did I answer your question? Mark my Post as Solution. Thanks

 

 

 

 

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.