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.
I need to do this formula in a DAX table:
1- First row = A * B
2- Second Row until the end = B * E (result of row before)
Can I do it in dax?
Solved! Go to Solution.
Hi @gbernardes_
I didn't have the chance to test it so please do from your end
Value =
VAR T1 =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Key AP] ) )
VAR Index1 =
MINX ( T1, 'Table'[Index] )
VAR Value1 =
MAXX (
FILTER ( T1, 'Table'[Index] = Index1 ),
'Table'[Valor] * ( 'Table'[INCC-M. Valor] + 1 )
)
VAR T2 =
FILTER (
T1,
'Table'[Index] <= EARLIER ( 'Table'[Index] )
&& 'Table'[Index] > Index1
)
VAR ProductValue =
PRODUCTX ( T2, 'Table'[INCC-M. Valor] + 1 )
RETURN
Value1 * COALESCE ( ProductValue, 1 )
Hi @gbernardes_
I didn't have the chance to test it so please do from your end
Value =
VAR T1 =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Key AP] ) )
VAR Index1 =
MINX ( T1, 'Table'[Index] )
VAR Value1 =
MAXX (
FILTER ( T1, 'Table'[Index] = Index1 ),
'Table'[Valor] * ( 'Table'[INCC-M. Valor] + 1 )
)
VAR T2 =
FILTER (
T1,
'Table'[Index] <= EARLIER ( 'Table'[Index] )
&& 'Table'[Index] > Index1
)
VAR ProductValue =
PRODUCTX ( T2, 'Table'[INCC-M. Valor] + 1 )
RETURN
Value1 * COALESCE ( ProductValue, 1 )
switch(
true(),
index =3 , ( [column A] * [Column B] )+ [Column A],
index >=4, ([column E] * [Column B] ) +[Column E]
)
@Anonymous the problem is: [Column E] in power BI is the calculated column. I can't use it in this formula.
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 |
---|---|
46 | |
26 | |
22 | |
12 | |
8 |
User | Count |
---|---|
73 | |
51 | |
45 | |
16 | |
12 |