Forum Discussion
DAX Not working as expected when I join Date Dimension table with Fact Table
Something to consider
Never start with difficult things. Start simple. Then build on top of that.
In your example.
If you setup a relation based between customer and date then what happens is:
When you select a date (or date range) you filter customer
So if you select 2017 Power BI will filter your 2017 customers
Any dax you write will be against above. UNLESS you invalidate the filter in your dax (which you have not done)
Try building your thing without dax first
Select 2017 and count the number of customers in 2017 using no dax just count customer id or something
Then add 2016 to your selection etc
To me it just sounds silly to let the user select a year and the expect to do a +1 and -1
What are the requirements is i select 2014 and 2020 ? 2013 till 2021 or 2013-2015 and 2020-2022
Just let the user filter the data based on the years selected.
No dax needed and pretty straightforward.
Still going for dax ? First check if above works. Then try to build your dax.
Dear Anonymous
Thank you for your quick support, i have invalidated context filter in the dax and it is working fine.