March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
Below are my tables, Order table and Cart table are related by Order ID. Cart and Message tables are related by Cart ID.
My requirement is to count the number of Orders by messages. I am expecting below output:
Number of Orders | Messages |
2 | Your order is not correct |
Can anyone help me how to get this output in DAX ?
Regards,
Shiva Kumar
Solved! Go to Solution.
Hi @ncbshiva
If you use the [Order ID] column from Cart table and use the aggregate type Count (or Count Distinct), you will get the result directly.
Or you can also create a measure Measure1 = COUNT(Cart[Order ID]) or Measure1 = DISTINCTCOUNT(Cart[Order ID]) and put it in the table.
Hi @ncbshiva
If you use the [Order ID] column from Cart table and use the aggregate type Count (or Count Distinct), you will get the result directly.
Or you can also create a measure Measure1 = COUNT(Cart[Order ID]) or Measure1 = DISTINCTCOUNT(Cart[Order ID]) and put it in the table.
@ncbshiva , Hop message, and cart are joined
ithink count should do
calculate(count(cart[order id] , not(isblank(Message[cart id])))
if needed
calculate(distinctcount(cart[order id] , not(isblank(Message[cart id])))
visualize with Message[Message]
Hi,
Thanks for the message.
As mentioned Cart and Message table is joined/related by Cart ID.
I tried the dax that you have provided, but i did not get the expected results.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |