We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi Team,
I have Product and value , if I select any two Product I need two lines with varience value of both ex. (P1-P2)
3rd lines expected (P1, P2 and varience line)
how to create Varience line in the below chart.
Note: I have select any two product names.


Thanks,
KV's
Solved! Go to Solution.
Hi @Anonymous ,
Please check:
1. Create a separate table.
Products =
UNION ( DISTINCT ( 'Table'[Product] ), { "Variance" } )
2. Create a measure.
Measure =
VAR P1_ =
MAX ( 'Table'[Product] )
VAR P1_Value =
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Product] = P1_ )
VAR P2_ =
MIN ( 'Table'[Product] )
VAR P2_Value =
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Product] = P2_ )
RETURN
SWITCH (
MAX ( Products[Product] ),
"Variance", P2_Value - P1_Value,
P1_, P1_Value,
P2_, P2_Value
)
3. Create a line chart.
Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
Hi @Anonymous ,
Please check:
1. Create a separate table.
Products =
UNION ( DISTINCT ( 'Table'[Product] ), { "Variance" } )
2. Create a measure.
Measure =
VAR P1_ =
MAX ( 'Table'[Product] )
VAR P1_Value =
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Product] = P1_ )
VAR P2_ =
MIN ( 'Table'[Product] )
VAR P2_Value =
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Product] = P2_ )
RETURN
SWITCH (
MAX ( Products[Product] ),
"Variance", P2_Value - P1_Value,
P1_, P1_Value,
P2_, P2_Value
)
3. Create a line chart.
Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
@Anonymous , You need to have three measures like
P1 = calculate(sum(Table[Value]), filter(Table, Table[Product] = "P1"))
P2 = calculate(sum(Table[Value]), filter(Table, Table[Product] = "P2"))
varience = [P1] -[P2]
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 38 | |
| 34 | |
| 22 |