Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone,
to begin with, thank you for beeing part of this cumminty 🙂
Since several days I am working now on this issue.
I have a list with stores and open dates (see beloew) and a DimDate Table
Store_ID Open Date
Store 1 15.01.2018
Store 2 20.02.2018
Store 3 10.03.2018
I want to calculate for each month the total amount of days a store was opened (instead od dynamic 30/31 days a fixed value of 30 for full month is ok).
Example
January February March or Year (Jan-March)
15+0+0=15 30+10+0=40 30+30+20=80 15+40+80=135
Is this possible, if yes, could you please help me with dax measure? Thank you very much in advance!
DoM
Solved! Go to Solution.
Hi @domdre35,
Please take a look at following measure formula if it suitable for your requirement:
Remain days = VAR _start = FIRSTDATE ( VALUES ( 'Calendar'[Date] ) ) VAR _end = LASTDATE ( VALUES ( 'Calendar'[Date] ) ) RETURN SUMX ( FILTER ( ALL ( Store ), [Open Date] IN CALENDAR ( _start, _end ) || [Open Date] <= _start ), DATEDIFF ( MAX ( [Open Date], _start ), _end, DAY ) )
Regards,
Xiaoxin Sheng
Hi @domdre35,
Please take a look at following measure formula if it suitable for your requirement:
Remain days = VAR _start = FIRSTDATE ( VALUES ( 'Calendar'[Date] ) ) VAR _end = LASTDATE ( VALUES ( 'Calendar'[Date] ) ) RETURN SUMX ( FILTER ( ALL ( Store ), [Open Date] IN CALENDAR ( _start, _end ) || [Open Date] <= _start ), DATEDIFF ( MAX ( [Open Date], _start ), _end, DAY ) )
Regards,
Xiaoxin Sheng
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 |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |