The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello
I need help to create a new measure based on a Balance Amount field. The measure need to calculate the daily perfomance, wich is today balance - previous day balance, except when it is a new year. If it is 1/1 we would like to show the current balance for that day.
I have a screenshot from excel showing an example.
Hi @jakob82 ,
Here are the steps you can follow:
1. Create calculated column.
Column =
var _mindate=
MINX(
FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(EARLIER('Table'[Date]))),[Date])
var _current=
SUMX( FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(EARLIER('Table'[Date]))&&'Table'[Date]=EARLIER('Table'[Date])),[Value])
var _last=
SUMX( FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(EARLIER('Table'[Date]))&&'Table'[Date]=EARLIER('Table'[Date])-1),[Value])
return
IF(
'Table'[Date]=_mindate,'Table'[Value],
_current - _last)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Ok thanks!
I thoght I had a solution with following measures:
Measure for Previous day balance:
GL Balance Amount Previous Day:=CALCULATE([GL Balance Amount], PREVIOUSDAY('Dim Balance Date'[Balance Date]), DATESYTD('Dim Balance Date'[Balance Date]))
Then a measure based on current day balance - Previous Day balance:
GL Balance Amount - Daily Change:=CALCULATE([GL Balance Amount] - [GL Balance Amount Previous Day])
And "GL Balance Amount - Daily Change" shows exactly what i want, EXCEPT when I look at the grand total.
The total show wrong total amount.. It is very weird I think. Any Idea what it is?
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |