Hi @Kosta88 ,
You can first use the if function to determine whether [MidLevel] contains {one,two,three} and [Postcode]=current [Postcode], etc.
if List.Contains({"one","two", "three"},[MidLevel])
then 1
else 0
In grouping to accumulate counts based on conditions:
Grouped Running Totals in Power Query • My Online Training Hub
Solved: Cumulative sum in Power query editor - Microsoft Power BI Community
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Kosta88 ,
Use one of the filters in the conditional column (I used 2) to see the syntax, then add the rest of the conditions to the formula bar. You will have to use "and" and "or". Note that the key words are all lower case, and you have to write out "then" and "else."
Finally you will need to filter the table based on your new column.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Hi @Kosta88
Where do your variables come from? Are they measures or columns? If they are measures this will not work. If they are column headings, then this would be a conditional column in Power Query - it will allow you to do the multiple conditions. Find this under Add Column tab.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Hi Nathaniel, thank you for the promt reply.
My variables are columns headings as you mentioned.
I have tried to go under transform data, addcolumn , custom column but I am not sure how to convert the DAX code to Power query syntax.
Could you please provide a sample code that could help me please.
Thank you again.
Kosta
Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.
Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!
User | Count |
---|---|
213 | |
53 | |
43 | |
42 | |
41 |
User | Count |
---|---|
267 | |
210 | |
73 | |
70 | |
64 |