Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi everyone,
I have an issue where im trying to count the number of days between two days that is determined by the year chosen. What i want is to have remaining days between start and end date being summed up in the year chosen in the filter context.
For example:
I have no problem in counting the dates (as shown), but im getting issues as soon as i am trying to put it into a sumx. The dates and datesdiff isnt' totalling correctly when the filter context is different from the date incurred (which the filter is connected to). The measure im using is as follows:
Hi @LasseLJørgensen the best practice will be to put two dates in column and in third column find simple difference like INT(date1)-INT(date2)
Still, if you need slicer affected difference, when one possible option is usage of SELECTEDVALUE function.
There is no model / details from your side for input and expected ouput to provide some solution.
Proud to be a Super User!
@some_bih
Hi there, im allready using a date table.
What im trying to do is count a datediff where the start and end up until 01-01 and 12-31 so that it counts the datediff in eg 2014 or 2015. the difference in dates has to 'fit' the year the start and end is located.
Hi @LasseLJørgensen I do not fully understand what you are need to get, but what I understand is that difference for some dates, best work with dates from Calendar / Date table. My practice when I need to calculate some difference for dates, min or max, I usually calculate some event date compared with Calendar / Date table date and put visual with this column. This is also best practice as unique key column is guaranteed compared with possible duplicated rows is eventually fact (your table). This could be sometimes trouble as context transition (usage of DAX function CALCULATE) perform differently on dimension compared to fact tables.
If possible, try to remodel your request from / toward Calendar / Date table.
Proud to be a Super User!
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 |
---|---|
55 | |
27 | |
23 | |
14 | |
11 |
User | Count |
---|---|
78 | |
63 | |
46 | |
17 | |
12 |