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
I have a measure that looks like this...
CUSTOMER_COUNT = COUNTX(FILTER('Table#1','Table#1'[Type] = "Evening"),'Table#1'[ID])
I also have a calendar table so when I drag the visual (table) to Canvas and drag the dates column from Calendar and CUSTOMER_COUNT I get the correct count based on the slicer values(which uses the same Calendar table)
So if the slicer is currently selected to show count for values between April 1 - April 30 2023 how can I write DAX for the same period last year, April 1- April 30 2022 using this same measure? If slicer is currently selected for Jan 1, 2023 - March 31 2023 how can I count for Jan 1 2022 - March 31 2022
Solved! Go to Solution.
@stribor45 Well, the errors would indicate that you have duplicate dates in your Calendar table, which doesn't make much sense as that is generally not the case. Again, just another reason to avoid DAX TI functions in my opinion. I don't use them, they are all just FILTER functions for the most part.
Wierd after all these attempts and trying different things it finally worked when I used the "vertical list" slicer. When I had the slicer set as "between" it didn't work at all.
I can see what the problem is. Dates have to be unique. My current calendar table needs to look like the above but I can create another table with unique dates and create a relationship to the Calendar table
this is what my calendar table looks like. its increasing by 1 minute
@stribor45 You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
@Greg_Deckler thank you for providing this. much appreciated. I am confused about why I am receiving error that I have duplicate dates in my calendar table. I dont have any duplicates at all and not sire why it is giving me the error. See this screenshot and hope you can assist me
@stribor45 Well, the errors would indicate that you have duplicate dates in your Calendar table, which doesn't make much sense as that is generally not the case. Again, just another reason to avoid DAX TI functions in my opinion. I don't use them, they are all just FILTER functions for the most part.
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 |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |