Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I'm trying to sum one column based on subsequent filers in DAX. Hopefully the below demonstrates what I want to do:
If I use the the formula in bold it's fine. However I want to include multiple contain filters on [CBS name] and include all 3. I can find what to do if they are straight forward filters but as I'm using the contains feature it makes it a bit trickier. I've tried || and IN functions and failed.
I could probably make it work creating multiple variables and summing them together but it feels like it should be easier.
I really appreciate any help.
Thanks
Hi @NMOORE ,
Here are the steps you can follow:
1. Create calculated column.
Tier 1 Total =
var _1={"NOP1","NOP2","NOP3"}
return
SUMX(FILTER(ALL('Table'),
CONTAINSSTRING('Table'[CBS Code],"1.1.2.4")&&
'Table'[CBS Name] in _1),[Budget])
2. Result:
If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you
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
Thanks alot for your reply. I would upload a PBIX file but it won't let me. It's returning a blank on my data.
If you add text at the end of CBS code and CBS name values on your table as per below it wont filter accordingly. I'm not sure why the contains string function is not working?
CBS Code | CBS Name | Budget |
1.1.2.3.21 | NOP1 EX1 | 1 |
1.1.2.3.21 | NOP2 EX1 | 2 |
1.1.2.3.21 | NOP2 EX1 | 5 |
1.1.2.4.21 | NOP1EX1 | 6 |
1.1.2.4.21 | NOP2EX1 | 4 |
1.1.2.4.21 | NOP3 EX1 | 7 |
1.1.2.4.21 | NOP4 EX1 | 1 |
1.1.2.4.222.1 | NOP1EX1 | 5 |
1.1.2.4.222.1 | NOP2EX1 | 5 |
Thanks again
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |