The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance 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.
User | Count |
---|---|
26 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
30 | |
15 | |
12 | |
12 | |
7 |