Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Dear All,
I have written the following measure:
The current measure does count 5 different delivery customer numbers. In the new situation three records should be excluded, so the final result of the new measure should be 2 different delivery customer numbers.
Thanks in advance for any suggestion to improve the measure.
Solved! Go to Solution.
Hi @Anonymous ,
Here are the steps you can follow:
1. Create measure.
count1 =
var _table1=
FILTER(
'Tbl_customer', SEARCH("PP_",'Tbl_customer'[Deliveryname],1,BLANK())=1&&CONTAINSSTRING('Tbl_customer'[Deliveryname],"PP_")=TRUE() || SEARCH("BX_",'Tbl_customer'[Deliveryname],1,BLANK())=1&&CONTAINSSTRING('Tbl_customer'[Deliveryname],"BX_")=TRUE() || SEARCH("PD_",'Tbl_customer'[Deliveryname],1,BLANK())=1&&CONTAINSSTRING('Tbl_customer'[Deliveryname],"PD_")=TRUE() )
return
IF(
MAX('Tbl_customer'[Deliveryname]) in SELECTCOLUMNS(_table1,"flag",[Deliveryname]),0,1)
count2 =
SUMX(ALL(Tbl_customer),[count1])
2. Result:
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
Hi @Anonymous ,
Here are the steps you can follow:
1. Create measure.
count1 =
var _table1=
FILTER(
'Tbl_customer', SEARCH("PP_",'Tbl_customer'[Deliveryname],1,BLANK())=1&&CONTAINSSTRING('Tbl_customer'[Deliveryname],"PP_")=TRUE() || SEARCH("BX_",'Tbl_customer'[Deliveryname],1,BLANK())=1&&CONTAINSSTRING('Tbl_customer'[Deliveryname],"BX_")=TRUE() || SEARCH("PD_",'Tbl_customer'[Deliveryname],1,BLANK())=1&&CONTAINSSTRING('Tbl_customer'[Deliveryname],"PD_")=TRUE() )
return
IF(
MAX('Tbl_customer'[Deliveryname]) in SELECTCOLUMNS(_table1,"flag",[Deliveryname]),0,1)
count2 =
SUMX(ALL(Tbl_customer),[count1])
2. Result:
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 a lot for your suggestion and it works quite well. I only miss a sum of the total number, so it just points out as '1''. In my original measure I make use of a SUMX, which rings me to a total number of delivery customer names for a specific customer . With the proposed measure it just turns out to 1 delivery customer name.
Thanks in adavcen for any additional thought to get this resolved.
User | Count |
---|---|
121 | |
69 | |
67 | |
57 | |
50 |
User | Count |
---|---|
176 | |
83 | |
69 | |
65 | |
54 |