Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello How can I count distinct order_no which are only coming from specific traffic sources (google, mail, bing)? So the distinctcount happens based on a pre-filtered data set (traffic sources). Thank you!
It sounds like a job for CALCULATE
CALCULATE(DISTINCTCOUNT('Orders'[order_num]),'Orders'[source] IN { "google", "mail", "bing" })
depending on the structure of your report and what the external filter context is you may have to add an ALL('Orders')
Join the conversation on We Talk BI
More about me on Slow BI
Help when you know. Ask when you don't!
Hi @kentyler
Thanks for your answer.
The data model is:
- unique order number is in 1 table.
- Google Analytics order number table ("google_analytics_order_no") is combined with this unique order number (1 to *)
- ERP data ("sales") is combined with unique order number (1 to *). My formula looks like this:
Hi @clarissa ,
Try trouble shooting your DAX
Order PMKT = CALCULATE(DISTINCTCOUNT(sales[order_no]), FILTER(google_analytics_order_no, google_analytics_order_no[source_medium] = "google / cpc" )
See if the formula is returning the correct value for "google/cpc".
Also, remove all trailing spaces by Trimming this column in Query Editor.
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi Harsh
Thank you for your feedback. Why do you think it is linked to the trailing spaces? I get numbers but the Google Analytics number is higher than the Sales Table Number, which doesn't make sense... Is the DAX Formula right or does it react differently if the distinctcount is applied on another table than the filter table?`
Thank you!
Hi @harshnathani
Unfortunately not, but here the data modell
Does that help? B2C_unique_order_number is joined with the 2 other tables with the order-no (1 to *)
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
33 | |
15 | |
14 | |
12 | |
9 |