The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I have the 2 tables shown below.
I need a DAX measure to calculate the balance, within the GiftSplit Table. (Balance = Pledge - PledgePayments)
I calculate:
SUMPledgeGiftSplit = calculate(SUM(RE_GiftSplit[amount]),RE_Gift[type]="Pledge")
SUMPledgePaymentGiftSplit = calculate(SUM(RE_GiftSplit[amount]),RE_Gift[type]="PledgePayment")
It doesn't work because GiftSplit[gift_id]=121 to 125 and the payments are on PledgePayment for which Gift[ linkedgift_id] 12=Gift[id] 12.
I tried :
PledgePaymentsGiftSplit =
VAR IDNO = SELECTEDVALUE(Gift[id])
RETURN
SUMX(FILTER(ALL(Gift),Gift[linkedgift_Id] = IDNO), GiftSplit[amount])
And I get this message : A single value for column 'amount' in table 'GiftSplit' cannot be determined.
I tried related and it doesn't work.
What am I doing Wrong? Thank You!
Solved! Go to Solution.
Thank you very much for the answer @amitchandak The requirements have been changed. Good Day.
@AH2022 , the first one is correct the second one need to me
calculate(SUM(RE_GiftSplit[amount]),filter( allselected(RE_Gift), RE_Gift[RE_Gift] =max(RE_Gift[Gift_id]) && [ID] <= Max([ID]) && RE_Gift[type]="PledgePayment") )
Thank you very much for the answer @amitchandak The requirements have been changed. Good Day.
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
10 | |
8 |