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 dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello Community,
I'm working on a report and I have difficulties to show some Amounts. The problem is due to a measure that I have developed and it is causing the problem. below is the formula that I'm using :
Amount =
VAR Main_Account_V2=ALLEXCEPT(Transaction,Transaction[MainAccount],MainAccount[Libellé de compte],'Transaction DataArea'[Entité Juridique])
VAR Min_Date_V2=CALCULATE(MIN(Transaction[AccountingDate]),ALLSELECTED(Transaction))
VAR AmountV2=CALCULATE(SUM(Transaction[AccountingAmountDebit])-SUM(Transaction[AccountingAmountCredit]),Main_Account_V2,FILTER(ALL(Transaction[AccountingDate]),Transaction[AccountingDate]>=Min_Date_V2),FILTER(ALL(Transaction[Concat_ID]),Transaction[Concat_ID]<=MAX(Transaction[Concat_ID])))
Return
IF(AmountV2=BLANK(),[OpeningBalance],AmountV2+[OpeningBalance])
And when I deselect the display measure I can see what I am displaying. bellow the capture...
Any ideas to solve this problem? Any solution to suggest?
Regards,
Thanks a lot.
Hi @Anonymous
I'd need to see the model to be able to give a more accurate answer. Can you share the pbix (by PM if necessary)?
In the meantime, I don't think it will make a massive difference but try this:
Amount =
VAR Main_Account_V2 =
ALLEXCEPT (
Transaction,
Transaction[MainAccount],
MainAccount[Libellé de compte],
'Transaction DataArea'[Entité Juridique]
)
VAR Min_Date_V2 =
CALCULATE ( MIN ( Transaction[AccountingDate] ), ALLSELECTED ( Transaction ) )
VAR maxConcat_ID_ =
MAX ( Transaction[Concat_ID] )
VAR AmountV2 =
CALCULATE (
SUM ( Transaction[AccountingAmountDebit] )
- SUM ( Transaction[AccountingAmountCredit] ),
Main_Account_V2,
FILTER (
ALL ( Transaction[AccountingDate] ),
Transaction[AccountingDate] >= Min_Date_V2
),
FILTER (
ALL ( Transaction[Concat_ID] ),
Transaction[Concat_ID] <= maxConcat_ID_
)
)
RETURN
[OpeningBalance]
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |