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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.