Forum Discussion

Victor_AguirreV's avatar
Victor_AguirreV
Regular Visitor
2 years ago
Solved

Issues with Relationships and Calculate function

Hello guys!   I have the following DataModel:     And what I am trying to do is get the total number of chargebacks, calculated by counting the primary key in All_CBs table called "Journal...
  • Victor_AguirreV's avatar
    2 years ago

    Hello Guys,

     

    I solved it. My apologies if someone was trying to figure this out. This was the solution:

     

    Total CBs by CB Date = CALCULATE([Total CBs],
        USERELATIONSHIP('Calendar'[Date], All_CBs[Date Chargeback])
    )
     
    Total CC Deposits by Date = CALCULATE([Total CC Deposits],USERELATIONSHIP(All_dep_bd[Short.Date],'Calendar'[Date]))
     
    CB Rate = DIVIDE([Total CBs by CB Date], [Total CC Deposits by Date])