Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Im trying to create a 1 Year IRR function. To do this I need an initial value. Below is my attempts at starting to calculate this value. I want to sum together all the values in the Multiple column up until the 1 Year (Adjusted) where the transaction type is equal to "Call" but I want this values to only be present when the date is the same as the 1 Year (Adjusted) date. Bellow is my attempt at doing this. In the first variable, I've summed up the Multiple column when the dates are what you want and the transaction type is Call. In the second variable I've then told power BI to output this result when the date is the same as 1 Year (Adjusted). But the CallMultipleValue is coming out blank. Just wondering if anyone knows what I've done wrong
VAR CallSumofMultiple =CALCULATE(CALCULATE(SUM(Transactions[Multiple]),FILTER(Transactions,Transactions[TransactionType]="Call"),FILTER(ALL('Calendar'),'Calendar'[Date]<=[1 Year (Adjusted)]))) VAR CallMultipleValue =IF([1 Year (Adjusted)]=[Max Calendar PME Date],CallSumofMultiple,BLANK()) RETURN CallMultipleValue
When I don't include the TransactionType filter in the CallSumofMultiple variable the code works as expected, so not sure if there's a better way to filter the Calls
Try this out but I don't have enough info to be sure that it'll do what you're after. You'd have to be more precise and post some screenshots of the model. The explanation of the calculation you've given is not razor-sharp.
[Initial Value] = VAR __boundaryDate = [1 Year (Adjusted)] VAR __maxCalendarPmeDate = [Max Calendar PME Date] VAR CallSumofMultiple = CALCULATE ( SUM ( Transactions[Multiple] ), -- Depending on what you want, you can try to remove -- KEEPFILTERS leaving only the statement it surrounds -- and see what you get. You should read about KEEPFILTERS -- if you haven't yet and how it changes the way -- filters from different contexts interact with each -- other. KEEPFILTERS( Transactions[TransactionType] = "Call" ), 'Calendar'[Date] <= __boundaryDate, ALL( 'Calendar' ) ) VAR CallMultipleValue = IF ( __boundaryDate = __maxCalendarPmeDate, CallSumofMultiple ) RETURN CallMultipleValue
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |