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.
Hello All,
I am facing difficulties in translating the Excel formula below to Power Bi:
=IF(Q2=1;IF(M1="No";"No";L2);"NA")
For sensible reasons I cannot show a screenshot of data. However column Q is based on an IF statement and the output is either 1 or 2. Column M is a text column where output is "Yes" or "No" and column L is equal to a number (Average Time). As you can see in the formula, Q and L columns seek information in row 2 whereas column M seeks information in row 1. My data is layed out in a chronological way. Hence each row is connected to the above row and this is the reason why I need a formula to involve the current row with the one jsut above above. In excel it is very easy to combine multiple conditions of different format and located on different rows. However as I understood in Power Bi, we need to work with columns and formulas and cannot get around easily as in Excel and just select whichever cells in our formulas.
I have explored several forums and videos and so far I know I must creat and index table (which I did) in order to refer to the row just above when including condition for column M. I aslo need to include functions such as Calcualte, Filter, Earlier, IF, SUM... However I have not find the right logic to develop my formula. I hope I have provided sufficient information to obtain help.
Thank you very much in advance.
Solved! Go to Solution.
@Anonymous
Your direction is correct. Somehow index is necessary. You need to use earlier to the pervious value or next value.
Column = SUMX(FILTER('Sheet1 (2)','Sheet1 (2)'[index]=EARLIER('Sheet1 (2)'[index])-1),'Sheet1 (2)'[amount])
The entire DAX should be something like below. You can modify by yourself. Thanks
column =
VAR M= SUMX(FILTER('Sheet1 (2)','Sheet1 (2)'[index]=EARLIER('Sheet1 (2)'[index])-1),'Sheet1 (2)'[amount])
Proud to be a Super User!
@Anonymous
Your direction is correct. Somehow index is necessary. You need to use earlier to the pervious value or next value.
Column = SUMX(FILTER('Sheet1 (2)','Sheet1 (2)'[index]=EARLIER('Sheet1 (2)'[index])-1),'Sheet1 (2)'[amount])
The entire DAX should be something like below. You can modify by yourself. Thanks
column =
VAR M= SUMX(FILTER('Sheet1 (2)','Sheet1 (2)'[index]=EARLIER('Sheet1 (2)'[index])-1),'Sheet1 (2)'[amount])
Proud to be a Super User!
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 |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |