Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
79 | |
53 | |
39 | |
36 |
User | Count |
---|---|
100 | |
85 | |
47 | |
46 | |
44 |