Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi,
I would like to build the Excel visualization (see screenshot) in PBI. I assume this is possible with a DAX measure? I've been playing around with some DAX functions and tried some solutions from previous posts, but I cannot get my head around it.
It basically needs to calculate the difference in Amount compared to the Amount of the previous date. It should be dynamic; new dates can get added to the table.
Any hints, tips are appreciated.
Best regards,
Armand
Solved! Go to Solution.
@az38 thank you for your proposal, but unfortunately it did not work out.
Eventually I found the solution using the following measures:
PreviousDate =
VAR CurrentDate =
SELECTEDVALUE ( 'Sheet1'[Date] )
RETURN
CALCULATE (
MAX ( 'Sheet1'[Date] );
ALLSELECTED ( Sheet1 );
KEEPFILTERS ( Sheet1[Date] < CurrentDate )
)
Amount previous date =
VAR Prev = [PreviousDate]
RETURN
CALCULATE (
[Total Amount];
Sheet1[Date] = Prev
)
Diff with previous =
[Total Amount] - [Amount previous date]
Diff % =
IF (
ISBLANK ( [Diff with previous] );
BLANK ();
DIVIDE ( [Diff with previous]; [Amount previous date] ) * 100
)
Hi @Anonymous
try a measure
diff = SELECTEDVALUE('Table'[Amount])-calculate(FIRSTNONBLANK('Table'[Amount];1);filter(ALLEXCEPT('Table';'Table'[Article]);'Table'[Date]<selectedvalue('Table'[Date])))
do not hesitate to give a kudo to useful posts and mark solutions as solution
@az38 thank you for your proposal, but unfortunately it did not work out.
Eventually I found the solution using the following measures:
PreviousDate =
VAR CurrentDate =
SELECTEDVALUE ( 'Sheet1'[Date] )
RETURN
CALCULATE (
MAX ( 'Sheet1'[Date] );
ALLSELECTED ( Sheet1 );
KEEPFILTERS ( Sheet1[Date] < CurrentDate )
)
Amount previous date =
VAR Prev = [PreviousDate]
RETURN
CALCULATE (
[Total Amount];
Sheet1[Date] = Prev
)
Diff with previous =
[Total Amount] - [Amount previous date]
Diff % =
IF (
ISBLANK ( [Diff with previous] );
BLANK ();
DIVIDE ( [Diff with previous]; [Amount previous date] ) * 100
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |