Forum Discussion
hi
Hello,
I want to count customer_code where customer_code starts with "90" or "91" and if there is a value in order_ID column
I have a measure as follows please help me to find the error
- Anonymous4 years ago
Hi abc_777 ,
Try this measuretest =calculate(countrows(Sheet1),FILTER(sheet1,LEFT(Sheet1[Customer Code],2) = "90" || LEFT(Sheet1[Customer Code],2) = "91"),FILTER(Sheet1,NOT(ISBLANK(Sheet1[Order ID]))))Regards,
Ashfiya
--------------------------------------------------------------------------------------------------------------------------
Did I help you today? Please mark my post as a solution and hit the Kudos button.
Hi,
Please check the below picture and the attached pbix file, whether it suits your requirement.
test = COUNTROWS ( FILTER ( 'bm_retail_t ssummary', CALCULATE ( MAX ( 'bm_retail_t ssummary'[Order_ID] ) ) <> BLANK () && OR ( LEFT ( 'bm_retail_t ssummary'[CUSTOMER_CODE], 2 ) = "90", LEFT ( 'bm_retail_t ssummary'[CUSTOMER_CODE], 2 ) = "91" ) ) ) + 0
8 Replies
- Jihwan_KimSuper User
Hi,
Please check the below picture and the attached pbix file, whether it suits your requirement.
test = COUNTROWS ( FILTER ( 'bm_retail_t ssummary', CALCULATE ( MAX ( 'bm_retail_t ssummary'[Order_ID] ) ) <> BLANK () && OR ( LEFT ( 'bm_retail_t ssummary'[CUSTOMER_CODE], 2 ) = "90", LEFT ( 'bm_retail_t ssummary'[CUSTOMER_CODE], 2 ) = "91" ) ) ) + 0 - AnonymousNot applicable
Hi abc_777 ,
Try this measuretest =calculate(countrows(Sheet1),FILTER(sheet1,LEFT(Sheet1[Customer Code],2) = "90" || LEFT(Sheet1[Customer Code],2) = "91"),FILTER(Sheet1,NOT(ISBLANK(Sheet1[Order ID]))))Regards,
Ashfiya
--------------------------------------------------------------------------------------------------------------------------
Did I help you today? Please mark my post as a solution and hit the Kudos button.
- abc_777Solution Specialist
thanks, both of you.
I tried both measures and when I filter with invoice_DT (invoice Date) column it's not given me the right result.
on august I have 2 customers starting customer_code 91 and 90 but it gives me blank
please help me how to filter to calendar date
- Jihwan_KimSuper User
Hi,
Please share your sample pbix file's link, and it will help me to investigate further to come up with a more accurate solution.
Thanks.
- abc_777Solution Specialist
Anonymous ,
may i ask where you from?
- AnonymousNot applicable
abc_777 ,
From India.