Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm having some trouble with creating a dax measure for my specific problem.
I have a fact table containing claims related to specific orders (Claims[CNo]). The fact table have two important date columns; one of which is representing the production date of a product (Claims[PDate]) and the other which is representing the date where the customer has issued a claim related to the product sold (Claims[CDate]. Currently the claim date is connected to a calender dimension; Calendar[Date].
If a product is produced in january (as indicated in Claims[PDate]), I need to count claims occuring in january and february (as indicated by Claims[CDate]. I.e. i'm interested in a 2m rolling count of claims, assuming a specific production month. I'm planning to represent this data in a table, showing the stats for each month over several years.
Thank you so much.
https://i.postimg.cc/13nhcKBq/picture.png
Solved! Go to Solution.
Hi @Anonymous ,
Why you not connect the PDate with the calendar table? Then you can use the following measure.
Measure =
CALCULATE (
COUNTROWS ( Claims ),
FILTER (
Claims,
Claims[CDate] >= MIN ( Calendar[Date] )
&& Claims[CDate] <= EOMONTH ( MAX ( calendar[Date] ), 1 )
)
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
Why you not connect the PDate with the calendar table? Then you can use the following measure.
Measure =
CALCULATE (
COUNTROWS ( Claims ),
FILTER (
Claims,
Claims[CDate] >= MIN ( Calendar[Date] )
&& Claims[CDate] <= EOMONTH ( MAX ( calendar[Date] ), 1 )
)
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@Anonymous you should have a relationship with calendar table on PDATE as well which will be inactive relationship and then you can add following measure to get the count:
Production Count =
CALCULATE ( COUNTROWS ( YourTable ), USERELATIONSHIP ( Calendar[Date], YourTable[PDate] ) )
Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi, and thanks for your help! 😊
I have included the suggestion into my PBI, but I am not sure how to connect all the dots.
I am able to count claims occuring this or last month by applying:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |