Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have made a graph with multiple lines (pictured as below). What I would like to know is at which value of x (and y) the lines meet each other?
My graph shows 2 lines. These are lines with the total amount we have to pay if we order more than 250 pieces of an item and a line with another price if we order more than 750 pieces of an item.
When we order an amount between 638 - 750 pieces it'll be cheaper to order 750 items and that's where these lines in the graph match.
My dataset contains the following items:
Price | Min. items to order | Start date | End date | Product | Min total amount |
2,74 | 250 | 1-1-2022 | 31-12-2022 | 1 | = Price * Min items to order |
2,329 | 750 | 1-1-2022 | 31-12-2022 | 1 | = Price * Min items to order |
Solved! Go to Solution.
Revise the metric to:
Dot =
VAR temtable =
SUMMARIZE (
ALL ( Quantity ),
Quantity[Value],
Quantity[250],
Quantity[750],
"QuantityValues", ( SUM ( Quantity[250] ) - SUM ( Quantity[750] ) )
)
VAR Q750 =
MAX (
MAXX ( FILTER ( temtable, [QuantityValues] < 1 ), Quantity[Value] ),
MINX ( FILTER ( temtable, [QuantityValues] > -1 ), Quantity[Value] )
)
RETURN
Q750
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMy Power BI file is here: https://we.tl/t-tj55SfNr5M
For now I don't have anymore dan a sample, we are still developing a database en screens for it.
Hi @henkvankester ,
I created the following measure:
Dot =
VAR temtable =
SUMMARIZE (
ALL ( Quantity ),
Quantity[Value],
Quantity[250],
Quantity[750],
"QuantityValues", ( SUM ( Quantity[250] ) - SUM ( Quantity[750] ) )
)
VAR Q750 =
MIN (
MAXX ( FILTER ( temtable, [QuantityValues] < 1 ), Quantity[750] ),
MINX ( FILTER ( temtable, [QuantityValues] > -1 ), Quantity[750] )
)
VAR Q250 =
MIN (
MAXX ( FILTER ( temtable, [QuantityValues] < 1 ), Quantity[250] ),
MINX ( FILTER ( temtable, [QuantityValues] > -1 ), Quantity[250] )
)
RETURN
IF (
Q750 = SUM ( Quantity[750] )
&& Q250 = SUM ( Quantity[250] ),
SUM ( Quantity[750] )
)
Now added the measure to the visual and turn on the marker result:
This is a simplification of the way we should calculate the intersection between the lines is not the matematical calculation but believe that we cna simplify.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThanks! I can indeed create a dot in the graph. What I'm really looking for is to add the value from the X-axis (quantity) in a card or table. When I try to do this with your measure the card shows 'empty'.
Hi @henkvankester ,
Use the following code:
Dot =
VAR temtable =
SUMMARIZE (
ALL ( Quantity ),
Quantity[Value],
Quantity[250],
Quantity[750],
"QuantityValues", ( SUM ( Quantity[250] ) - SUM ( Quantity[750] ) )
)
VAR Q750 =
MIN (
MAXX ( FILTER ( temtable, [QuantityValues] < 1 ), Quantity[750] ),
MINX ( FILTER ( temtable, [QuantityValues] > -1 ), Quantity[750] )
)
RETURN
Q750
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThanks, only now I see the value of the Y-axis, but I'm looking for the value of the X-axis.
We would like to know at which point it is cheaper to order more items and now it shows whats how much it costs at that point.
Revise the metric to:
Dot =
VAR temtable =
SUMMARIZE (
ALL ( Quantity ),
Quantity[Value],
Quantity[250],
Quantity[750],
"QuantityValues", ( SUM ( Quantity[250] ) - SUM ( Quantity[750] ) )
)
VAR Q750 =
MAX (
MAXX ( FILTER ( temtable, [QuantityValues] < 1 ), Quantity[Value] ),
MINX ( FILTER ( temtable, [QuantityValues] > -1 ), Quantity[Value] )
)
RETURN
Q750
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @henkvankester ,
How are the lines created in the chart you are using the 250/750 column on the legend or are you using two metrics?
Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |