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.
Hi all
How can I have returned a value that precedes the maximum from the column called demand?
For example:
The max demand is December with 450 and its capacity is 282, so how can I have in a measure returned 195 and also seprately in another measure its capacity 293?
I already have the max demand measure and its respective capacity with the below measures:
Max demand =
MAXX(
VALUES(demand[Date]),
[Production]
)
Capacity of max demand =
CALCULATE (
SUM ( demand[Capacity] ),
TOPN ( 1, ALLSELECTED (demand[Date] ), [Production], DESC )
)
Pbix is https://1drv.ms/u/s!ApgeWwGTKtFdh2jsDOgDc0mJVwJa?e=MKqjBa
Thanks!
Solved! Go to Solution.
Hi @o59393
Please download this file: https://gofile.io/d/4TBWuq
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Here is one way to get the demand prior to the max demand. You can adapt the approach for the capacity value. Just change the SUM in the return to use the Capacity column instead.
Prev Demand =
VAR summary =
SUMMARIZE ( demand, demand[Date], demand[Demand] )
VAR dateofmaxdemand =
MAXX ( TOPN ( 1, summary, demand[Demand], DESC ), demand[Date] )
RETURN
CALCULATE (
SUM ( demand[Demand] ),
demand[Date] = EDATE ( dateofmaxdemand, -1 )
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Here is one way to get the demand prior to the max demand. You can adapt the approach for the capacity value. Just change the SUM in the return to use the Capacity column instead.
Prev Demand =
VAR summary =
SUMMARIZE ( demand, demand[Date], demand[Demand] )
VAR dateofmaxdemand =
MAXX ( TOPN ( 1, summary, demand[Demand], DESC ), demand[Date] )
RETURN
CALCULATE (
SUM ( demand[Demand] ),
demand[Date] = EDATE ( dateofmaxdemand, -1 )
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @mahoneypat
Solved. Getting used to the new icons jeje.
Prev capacity =
VAR summary =
SUMMARIZE ( demand, demand[Date], demand[Demand] )
VAR dateofmaxcapacity =
MAXX ( TOPN ( 1, summary, demand[demand], DESC ), demand[Date] )
RETURN
CALCULATE (
SUM ( demand[Capacity] ),
demand[Date] = EDATE ( dateofmaxcapacity, -1 )
)
Thanks!
Hi @mahoneypat
Thanks a lot. I am trying to re-applicate with capacity however I'm having some difficulties.
Why demand looks like the icon circled below? We didn't create a measure and it's just a column.
If I try with capacity I don't get anything as seen underlined below in red:
I also tried the following but didn't get the 293 desired result:
How can i make it work?
Thanks!
Hi @o59393
Please download this file: https://gofile.io/d/4TBWuq
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi @o59393
Yes I used the dates to find the precede data.
Is that what you need?
Appreciate your Kudos!!
Yeap, thanks!
You are welcome!
If my post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
@VahidDM question
I need to use the measure "Production" within your measure.
I tried the following but see the error:
How can I make it work?
Thanks!
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 |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |