Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello, I don't know if I must introduce myself, but I have a question about a DAX-formula.
I want a line in a visual that shows the total sum over the selected years, I have now a formula that begins with the start of a year till the end of that year from the selected filter from the slicer.
But I want that it starts from the minimum year to the maximum year of the selected years from the slicer.
Solved! Go to Solution.
Hello, I found the right syntax, it works now!
Hello, I found the right syntax, it works now!
Hi @MEkin ,
Please try this:
Netto Opgeslagen Energie 2 =
var _min=CALCULATE(MIN('Table'[date]),VALUES('Table'[date]))
var _max=CALCULATE(MAX('Table'[date]),VALUES('Table'[date]))
return
CALCULATE (
SUM (view_Energie[Energie_Totaal_MWh] ),
filter(ALL(view_Energie),
view_Energie[Datum]>= _min
&& view_Energie[Datum] <= _max
)
)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-tangjie-msft , thanks for your reply.
It didn't work, it selects the min and max value, but doesn't apply to the query.
Here's the document, It would be great if we can fix this.
Hi @MEkin ,
Please refer to:
How to provide sample data in the Power BI Forum
Best Regards,
Neeko Tang
Hi, I uploaded it with WeTransfer, can you take a look? Thanks!
Hi @MEkin ,
Unfortunately, I can't open your link. Please check if your link is private, is your PBIX file private?
Best Regards,
Neeko Tang
I'm sorry, and this one.
https://drive.google.com/file/d/1Hbq0sjcwNAcYR0mGujcWtfXECAZqjKRf/view?usp=sharing
Hi, thanks again, but also starts with each year over.
I have a working formula, but this starts from the beginning of the table, not from the minimum value of the selected slicer. If we can adjust this one to start from the MIN(Slicer) it will be the solution.
In the picture u see -207, but this is a sum from the year 2013 from the table.
FilterStartDate = MIN( view_Energie[Datum].[Date] )
StartDate = MIN( view_Energie[Datum].[Date] )
Netto Opgeslagen Energie 2 =
CALCULATE (
SUM (view_Energie[Energie_Totaal_MWh] ),
filter(ALL(view_Energie),
view_Energie[Datum].[Date] >= MIN([FilterStartDate],[StartDate] )
&& view_Energie[Datum].[Date] <= MAX(view_Energie[Datum].[Date] )
)
)
Hello FreemanZ, thanks for your reply, unfortunally I already had this calculation, this one also starts from january in the next year.
See the screenshot, I would like to continue the line over the year, independed of the years. The put a red line how it should go over to next year and not start again counting from january.
hi @MEkin
then how about:
hi @MEkin
try like:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |