The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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 *)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
19 | |
18 | |
18 | |
14 |
User | Count |
---|---|
36 | |
34 | |
20 | |
19 | |
15 |