Forum Discussion

Simone2004's avatar
Simone2004
Helper I
5 years ago

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

Hi everyone,

 

I have this model:

 

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

 

When I add payment date all published requests disappear:

 

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

 

Thank you

 

10 Replies

  • aj1973's avatar
    aj1973
    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)

     

    • Simone2004's avatar
      Simone2004
      Helper I

      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?

      • rourique's avatar
        rourique
        Regular Visitor

        Research how to create power BI measures.

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

         

  • I cannot believe, a thing simple like this is so difficult in power bi ðŸ˜¥