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.
Hi Everyone
I have one that stumped me.
I want to sum $ values from one table based one dates from the this table and another table.
Example:
contact_table
CID failed_payment_date
123 2018-12-01
payments_table
CID payment_date payment_amount
123 2018-09-01 100
123 2018-10-01 100
123 2018-11-01 100
123 2019-01-01 100
123 2019-02-01 100
I want to sum all payment amounts after the failed payment date ie. the sum would be 200
The tables are joined on the CID.
essentially im looking for
IF
'TB.B' [payment_date ] >= 'TB.A'[failed_payment_date] THEN SUM(payment_amount)
How do I accomplish this? new columns? USERRELATIONSHIP in a formula, etc?
Also to clear... Im fairly new to PBI and the first post in Community, I did dig through past posts and didnt really find what i was looking for, any help is much appreciated. Thanks!
Solved! Go to Solution.
Hi @SheaBear,
create a 1-to-many relationship between concact_table and payment_table and then use this formula
= SUMX ( contact_table, VAR FailDate = contact_table[failed_payment_date] RETURN CALCULATE ( SUM ( payments_table[payment_amount] ), payments_table[payment_date] > FailDate ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @SheaBear,
create a 1-to-many relationship between concact_table and payment_table and then use this formula
= SUMX ( contact_table, VAR FailDate = contact_table[failed_payment_date] RETURN CALCULATE ( SUM ( payments_table[payment_amount] ), payments_table[payment_date] > FailDate ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hey @LivioLanzo - Thank you sir. Yes with some additional pieces that did the trick.
Hi @SheaBear
can you post a screenshot of what is happening?
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @LivioLanzo
Sure
What im seeing is when drill down is on with a split by custom ID you can see it shows the right total by "cohort" meaning month, but behind the scenes its still totaling out to be sky high.
For Context the below is only showing 1 cohort which should show that 20k as the total in the grand total at the bottom, but it shoots to 126 million.
hI @SheaBear
what is difference between the contact table and IFS 1 table?
in my measure VAR FailDate is coming from the contact table, but i see it is not the case in your measure
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
98 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |