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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Simone2004
Helper I
Helper I

How to create a 0...1/Many relationship

Hi everyone,

 

I have this model:

Simone2004_0-1623852211150.png

 

A request can have 0 or 1 payments;

Dimension_time is related to requests;

Dimension_time (2) is related to payments.

 

In the report, I just want to see request_id, creation date of the request (dimension_time -> date) and, if exists, payment date (dimension_date 2 -> date)..

 

This is the result I see before I insert payment date in the report

Simone2004_1-1623853755675.png

 

When I add payment date all published requests disappear:

Simone2004_2-1623853865723.png

 

What I expected instead is seeing all requests with payment date NULL... What do I have to change?

 

Thank you

 

10 REPLIES 10
Simone2004
Helper I
Helper I

I cannot believe, a thing simple like this is so difficult in power bi 😥

Hi @Simone2004 ,

 

I used the same model to create sample data, and I was able to get the payment date for all request_id.

 

image.png

image.png

 

You can see the difference between my model and yours. If possible, could you please share your PBIX file without sensitive data? 

 

Best Regards,
Winniz

aj1973
Community Champion
Community Champion

Hi @Simone2004 

You can't just insert the Payement date in the visual, you need to create a measure that will bring and insert that date into the visual. Use CALCULATE(SELECTEDVALUE( the date here), USERELATIONSHIP(column date from dimension_time , column payement date key from payments fact table)

 

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

where do I have to create the measure column? In the requests fact table?  Dont I have to use a relationship between requests and payments by request_id?

Research how to create power BI measures.

the code is at the top of the screen and the measurements in the right corner.

 

yes, but to create a Measure I must select a table... Which table do I must select?

  • The payments fact, make no sense I suppose;
  • The requests fact, I suppose I must create a relation between requests fact and payments fact in the DAX Function... no?

@Simone2004 

Why do you need to add a column, you just need to create a measure to call the date of payments and then add that measure to your visual.

Did you try the measure I asked you to add?

 

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

I am sorry but I do not understand what you mean... 

I do not want to create a column, but honestly I do not know how to create a Measure is not related to a table....

 

However.... I have tried something...

 

If I click on "New Measure" on the top, Power BI automaticallycreate the measure in the Payments Fact table.. and the result is an empty table:

Simone2004_0-1623877810595.png

 

If I create a measure selecting the Requests Fact table 

Simone2004_1-1623877927701.png

 

I get always an empty table

Simone2004_2-1623877996964.png

 

 

In both case, the measure is this:

Simone2004_3-1623878027437.png

 

Replace that by 

aj1973_0-1623878343943.png

by

aj1973_1-1623878418580.png

and try again

 

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

It seems it does not work... just infinite loading and empty visual... 

It could be because the registry_time table has already an active relation with the creation_date?   

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.