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.
Hi Community! I have an question on how to mimic an Excel if-then-else formula in Power BI. I don't want to use the function in the Excel base table, as I want to let PowerBI do all the work and calculations.
See here an example: I want to assign a certain value to the column "aantal", based in a comparison in the column "DatumTijdTee" of the current and the previous row value. Hope the picture explains better:
Is this a simple function, or do I have to create complicated DAX expressions?
Thanks for your help!
Solved! Go to Solution.
It can also be done in Power Query (M).
Code will be most efficient when you have the relevant current and previous values in 1 row.
This can be done by adding 2 index columns (1 starting with 0 and the other starting with 1) and then merge the table with itself.
An example in this video I created yesterday as an answer to a similar case.
<Hello Marcel,
thanks for the solution, especially the video. This helped me very much with my question!
Cheers, Joop
It can also be done in Power Query (M).
Code will be most efficient when you have the relevant current and previous values in 1 row.
This can be done by adding 2 index columns (1 starting with 0 and the other starting with 1) and then merge the table with itself.
An example in this video I created yesterday as an answer to a similar case.
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 |
---|---|
106 | |
104 | |
77 | |
68 | |
61 |
User | Count |
---|---|
148 | |
107 | |
106 | |
82 | |
70 |