Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Dear community,
I have this unexpected error happening on a measure mean to calculate the difference between two lines:
Hi,
Does this work
VAR Index = MIN('Market List'[Fare Index])
VAR Reference = MIN('Market List'[QF DATA.Cxr])
Hi @Ashish_Mathur Ashish,
While Fare Index is a whole number value QF DATA.CXR is text, not sure I can use MIN here.
any alternative?
Thanks
Alberto
Hi,
Explain the business question, share some data and also show the expected result.
i'm trying to redo this:
https://community.powerbi.com/t5/Desktop/Difference-between-two-rows/m-p/557974#M262996
but fields have different names..
The goal is making the difference between 460 - 392.01 and the following rules.
hope it clarifies
Hi @Anonymous ,
We can try to use the following measure to meet your requirement based on your previous post:
Trade Up 2 =
VAR index =
MAX ( 'QF Core Pricing'[Fare Index] )
VAR re =
MAX ( 'QF Core Pricing'[Restriction] )
RETURN
IF (
re = "NP",
CALCULATE ( MIN ( 'QF Core Pricing'[AIF] ) )
- CALCULATE (
MIN ( 'QF Core Pricing'[AIF] ),
FILTER (
ALLSELECTED ( 'QF Core Pricing' ),
'QF Core Pricing'[Fare Index] = index - 1
&& 'QF Core Pricing'[Restriction] = "P"
)
),
CALCULATE ( MIN ( 'QF Core Pricing'[AIF] ) )
- CALCULATE (
MIN ( 'QF Core Pricing'[AIF] ),
FILTER (
ALLSELECTED ( 'QF Core Pricing' ),
'QF Core Pricing'[Fare Index] = index
&& 'QF Core Pricing'[Restriction] = "NP"
)
)
)
If it doesn't meet your requirement, Could you please provide a sample mockup table based on fake data or describle the fields of each tables and the relations between tables simply? Please don't have any Confidential Information or Real data in your reply.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI @v-lid-msft
i tried to readapt according to my queries:
Trade UP QF =
VAR Index=
MAX ('Market List (Tariff)'[Fare Index])
VAR Re=
max('QF DATA'[Peak])
RETURN
IF(
RE="Non Peak",
calculate (MIN ('Market List (Tariff)'[QF DATA.AIF]) )
- CALCULATE(
min ('Market List (Tariff)'[QF DATA.AIF]),
filter (
ALLSELECTED('Market List (Tariff)'),
'Market List (Tariff)'[Fare Index] = Index - 1
&& 'Market List (Tariff)'[QF DATA.Peak]="Peak"
)
),
calculate(min('Market List (Tariff)'[QF DATA.AIF]) )
- calculate(
min ('Market List (Tariff)'[QF DATA.AIF]),
filter (
ALLSELECTED('Market List (Tariff)'),
'Market List (Tariff)'[Fare Index]=Index
&& 'Market List (Tariff)'[QF DATA.Peak]="Non Peak"
)
)
)
But as you can see from this other example some trade up worked...
let me know if clear enough