Forum Discussion
Relationship or DAX Error
- 3 years ago
encamped1 Hope my solution was able to meet your requirement. If yes, please mark it as "Accept as Solution". Thanks!
** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search and help others. Thank you !
Good Luck 👍
encamped1 Thanks for your query. Can you please share the pbix file?
ghoshabhijeet The link was already provided in the original post
- ghoshabhijeet3 years agoSolution Supplier
encamped1 Thanks for directing me to the file. At my first view of your post, the link was not there somehow and that's why I wrote my earlier comment.
Will try to solve your query. Thanks !- ghoshabhijeet3 years agoSolution Supplier
encamped1 Here is my solution. Hope this meets your requirement.
1. The calendar table you had created was not correct and due to which relationship you had created between the Calendar table and Data table wasn't working properly, since it was showing many to many relationship. You should use CALENDAR() or CALENDARAUTO() function to create calendar. Ideally the relationship should be One-to-Many (Calendar Table - to - Data Table)
2. Here are the two measures that I have created:
CY Count = CALCULATE(DISTINCTCOUNT(Deal[Deal Number]), Deal[Revenue Band] = "0-250k")
PY Count = CALCULATE(DISTINCTCOUNT(Deal[Deal Number]), SAMEPERIODLASTYEAR('Calendar Table'[Date]), Deal[Revenue Band] = "0-250k")
Here is the final output:** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search and help others. Thank you !
Good Luck 👍
- ghoshabhijeet3 years agoSolution Supplier
encamped1 Hope my solution was able to meet your requirement. If yes, please mark it as "Accept as Solution". Thanks!
** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search and help others. Thank you !
Good Luck 👍