Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi guys,
I am looking for something like COMPAREX statement.
Imagine that I have two tables.
Table one contains sales data per day and identificator and products, Table to Contains identificator (relationship between these two tables is established byse on it) and treshold.
What I need to create is measure where is if statement:
if treshold >= sum of sales then SUMX
This is easy in terms of selection only one product but in case I select more products then the evalution will bring the incorrect results as the if statement will be like that:
if (treshold 1 + treshold 2) >= (sum of sales 1 + sum of sales 2) then SUMX
However I would need something like this:
if (treshold 1 >= sum of sales 1) then SUMX1 + (treshold 2>=sum of sales 2) then SUMX2
But imagine that there is bung of products so not possible to hard code it like this.
Any ideas?
Thanks in advance
Hi @JorisVoorn,
If you want to use DAX, you may use if function like below.
if(expression1>expression2,true result,false result, if(...),...,...)
If you want to use Power Query, you could have a reference of this blog.
If you need further help, please share some data sample and your desired output.
Best Regards,
Cherry
User | Count |
---|---|
140 | |
113 | |
104 | |
76 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |