Forum Discussion

Peter_Sun's avatar
Peter_Sun
Frequent Visitor
9 years ago

Distribution Point Calculated on Power BI

Hi All, 

 

Could anyone help me solve below business scenarions? 

 

Distribution Point Definition: One product sold to one customer with real purchasing value amonnt ( we might send customer samples for free and this of couse won't be calculated as DPs) called One DP. 

 

I need to use a DAX to do this calculation. 

 

I tried to use DISTINCTCOUNT Function, but it could only tell me how many products are sold per month, or how many customers we have per month. I need sort of combing them altogether. 

 

I could do this in Excel using Countif  as below (1) and came out the DPs as (2)

On below tables (3) is customer name and (4) is products purchased by this customer. 

 

 

We might want to know how many DPs we are having per month or per quarter. 

 

Really Appreciate if anyone could solve me this puzzle. 

 

Thanks,

Peter Sun 

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    If you can post some sample raw data I can be more specific. Otherwise, the general replacement for COUNTIF in DAX is CALCULATE like so:

     

    Measure = CALCULATE(COUNT([Column]),FILTER(Table,[Column/Measure] > 0))

    Something along those lines.

    • Peter_Sun's avatar
      Peter_Sun
      Frequent Visitor

      Thanks for your quick reply 

       

      And please see below raw data and it is quite falt comparing with pivot table. 

      If only used below calculated measure, it would only get the how many products are sold, right?

       

      Can you please help me? Thanks