Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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 @Anonymous
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 @Anonymous
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.
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
14 | |
11 | |
9 |