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 Gang,
I hope you are all doing well in these difficult times.
I have an issue creating a column formula. I want to sum the number of sales (in a column) but I would like to exclude some specific cases:
example data:
Division | Vendor Nbr | Location | Sales |
X | 4444 | 445 | 4 |
Y | 4000 | 400 | 5 |
X | 4400 | 445 | 6 |
Z | 5000 | 300 | 4 |
I would like in these examples to sum the Sales made but to exclude lines that have Division=X, Vendor Nbr=4444 and Location=445. Meaning it should not count the first line but the three others as the third one don't have the three parameters to exclude it. The result would be 15 in this example. Would it be possible to add more cases to exclude?
Best regards and stay safe,
Marc Dahlgren
Solved! Go to Solution.
@Anonymous ,
I will suggest you to create one more column "Miscellenous" and enter first value as NULL or BLANK and keeping some values in rest of the rows. After the create create simple DAX Measure to achieve your requirement:
Division | Vendor Nbr | Location | Sales | Misc |
X | 4444 | 445 | 4 | |
Y | 4000 | 400 | 5 | 1 |
X | 4400 | 445 | 6 | 2 |
Z | 5000 | 300 | 4 | 3 |
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
Hi @Anonymous ,
Please try the DAX below:
Column 2 =
IF (
'Table'[Location] = 445
&& 'Table'[Division] = "X"
&& 'Table'[Vendor Nbr] = 4444,
0,
CALCULATE ( SUM ( 'Table'[Sales] ), ALLSELECTED ( 'Table'[Sales] ) )
)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please try the DAX below:
Column 2 =
IF (
'Table'[Location] = 445
&& 'Table'[Division] = "X"
&& 'Table'[Vendor Nbr] = 4444,
0,
CALCULATE ( SUM ( 'Table'[Sales] ), ALLSELECTED ( 'Table'[Sales] ) )
)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous ,
I will suggest you to create one more column "Miscellenous" and enter first value as NULL or BLANK and keeping some values in rest of the rows. After the create create simple DAX Measure to achieve your requirement:
Division | Vendor Nbr | Location | Sales | Misc |
X | 4444 | 445 | 4 | |
Y | 4000 | 400 | 5 | 1 |
X | 4400 | 445 | 6 | 2 |
Z | 5000 | 300 | 4 | 3 |
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
Try like
calculate(sum(table[Sales]),table[Vendor Nbr]<>4444, table[Location]<>445)
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 |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |