Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi there, I am spending way too much time on this measure and I would think that it is actually easy but I can't wrap my head around it.
So as you may notice in the picture, the area which I surround green is 2020 and the area afterwards is 2021. You can see that in 2022 it drops to 0 (good), but I actually want this to happen at the date of TODAY ().
So basically for my current year (2021) I want it to continue only till the red line, but for 2020 I want to see the whole year like it is right now.
When that is done, I basically want to create two seperate lines. One line that shows the current year (in this case 2021) till TODAY () and the other line that shows the previous year from 01/01/2020 till 31/12/2020.
Does someone know how to do this? Thanks so much and I appreciate your help in advance!
Extra info*** I can only use Calendar[Date] on my Axis since a lot of my measures are based on SELECTEDVALUE(Calendar[Date]).
This is the measure I am currently using for this line chart:
Solved! Go to Solution.
Hi, @Gjakova
According to your description and requirement, I can understand what you want to get, you can try my steps:
I’ve also created some test data to follow your situation, this is part of my test data:
CURRENTYEAR =
IF(
MAX('Table'[Date])>=DATE(YEAR(TODAY()),1,1)&&
MAX('Table'[Date])<=TODAY(),
SUM('Table'[Amount]),
BLANK())
PREVIOUSYEAR =
IF(
YEAR(MAX('Table'[Date]))=YEAR(TODAY())-1,
SUM('Table'[Amount]),
BLANK())
And you can get what you want.
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Gjakova
According to your description and requirement, I can understand what you want to get, you can try my steps:
I’ve also created some test data to follow your situation, this is part of my test data:
CURRENTYEAR =
IF(
MAX('Table'[Date])>=DATE(YEAR(TODAY()),1,1)&&
MAX('Table'[Date])<=TODAY(),
SUM('Table'[Amount]),
BLANK())
PREVIOUSYEAR =
IF(
YEAR(MAX('Table'[Date]))=YEAR(TODAY())-1,
SUM('Table'[Amount]),
BLANK())
And you can get what you want.
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Gjakova , See like you need cumulative
Try a new measure like
Cumm Revenue =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
return
CALCULATE([Realised Revenue],filter(allselected('Date'),'Date'[date] <=max('Date'[Date]) && 'Date'[Date] <= _max))
Hi @amitchandak thank you for your help, but I'm actually looking to just split these results in two measures.
So one for CURRENTYEAR (2021) and one for PREVIOUSYEAR (2020).
The green area is 2020 and the red one is 2021.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
104 | |
103 | |
87 | |
61 |
User | Count |
---|---|
162 | |
132 | |
131 | |
95 | |
86 |