Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi to everybody
I have a table . If the Service Code Column is like %RADMI%, the units column is returned else 0 is returned. In below example only Code 1,2,3,8 will return the units in a calculated colmn
Code ServiceCode Units Calculated Colunm ( I want this column with below values to be returned)
1 RADMIN 3 3
2 RSADMIN 2 2
3 RTADMINR 1 1
5 TMEBASE 4 0
6 NONWrK 2 0
7 HOLDAY 6 0
8 RHADMINT 3 3
Can anyone help me. I appeciate
Solved! Go to Solution.
For R%ADMI% try
IF(AND(Left('TableName'[ServiceCode],1)="R", ContainsString('TableName'[ServiceCode],"ADMI")),'TableName'[Units],0)
Try this. Change TableName to the name of your table. This should only work for a calculated column. You would need different dax if you want it as a measure.
IF(ContainsString('TableName'[ServiceCode],"RADMI"),'TableName'[Units],0)
Thank you. Unfortunately it does not work. If you use the comparison "RADMI", then row RSADMIN gets a value of 0.
We nee to have a combination R%ADMI%. Can you assist. Thanks
For R%ADMI% try
IF(AND(Left('TableName'[ServiceCode],1)="R", ContainsString('TableName'[ServiceCode],"ADMI")),'TableName'[Units],0)
Thank you so much Anthony. It works beautifully well.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |