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 have mutiple conditions that I want to implement is one DAX formula, there can be multiple dax formulas for multiple conditions for now I have 8 conditions, I want to write this in such a way so that I place all the values by filtering out billing key, customer key and material key and values coming in the date periods (lets say 4APRIL 2019 to 1APRIL 2020) among the actual tables that I have. How can I build a custom columns using this?
If all your columns are in the one table you can just combine the multiple filter conditions using the logical and ( && ) or the logical OR ( || ). So to filter for material key 123 AND customer 456 and dates between 4 April 2019 and 1 April 2020 you could do something like the following
= IF ( table[MaterialKey] = 123
&& table[CustomerKey] = 456
&& table[Date] >= DATE(2019,4,4)
&& table[Date] <= DATE(2020,4,1) ,
<result to return goes here> )
But your requirements are a little vauge so I'm not sure if I've understood them correctly. If not could you provide some example data and show the expected results to help illustrate a specifc example of the logic you are trying to apply?
Thanks for your answer below is what I have and what I need:
I have an excel with certain different conditions For Example
Document Group Value
ZBDC 11 0.5
ZBFI 22 0.5
ZBDC 33 1.0
Now my actual query where I will create my custom column looks like this
Document Group Volume
ZBDC 11 103.2
ZBDC 23 2000
For some Conditons is like whenever document and group matches take the Value as it is. In the same way I have another table like:
Document Group MaterialGroup Value
ZBDC 11 06 2.5
ZBDC 22 25 1.2
ZBDS 21 blank 1.2
For the above data I need to mutiply Value x Volume and put that inside my custom column, now both the dataset that are not highlighted are in the same table, how can I write the queries to pick values directly from one table and apply my condition, the way that I am doing here is manually entering the values inside my different columns for each conditions and sum all of those and divide by another field and subtract the outcome from another field and use that in my report. below is a small example of one of my DAX queries:
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |