Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ADSL
Post Prodigy
Post Prodigy

Count the number of purchase outlet

Hi BI Community Team,

 

To count the number of purchase outlet, I need to combine the column [Customer Code]&[Saleman Code] --- [Merge Cust with SR] and apply the measure below.

 

Measure 01 -- Dist_Count Active Store = DISTINCTCOUNT('Actual Sales'[Merge Cust with SR])

 

Measure 02 -- Total Active Store = CALCULATE([Dist_Count Active Store],'Actual Sales'[BillingType]="ZF2",'Actual Sales'[Price Type]="SALE")

 

2022-10-05_15-15-16.jpg

 

Any suggestion of measure/metric that we can create only one and get the same result? 

 

Thanks and Regards,

 

 

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @ADSL 

 

Why not try calculating distinct count in the second measure directly?

Total Active Store =
CALCULATE (
    DISTINCTCOUNT ( 'Actual Sales'[Merge Cust with SR] ),
    'Actual Sales'[BillingType] = "ZF2",
    'Actual Sales'[Price Type] = "SALE"
)

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Hi @v-jingzhang,

 

Thank you for your feedback.

 

Yes, currently I followed your measure. But we need to use the merge column name --- Merge Cust with SR that it's coming from  [Customer Code]&[Saleman Code] in power query.

 

It seem double job to merge and using it. Could we have another way/measure that can calculate and have two columns  [Customer Code]&[Saleman Code]?

 

Best Regards,

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.