The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
Hope someone knows the answer... My formula to conunt the numer of days in a year a contract is active don't work. I use the following formule:
_TotalDays of a contract in period =
VAR StartPeriode = MIN(Datumtabel[Date])
VAR EindPeriode = MAX(Datumtabel[Date])
RETURN
SUMX(
FILTER(
F_Contracten,
-- Alleen toewijzingen die overlappen met de periode
NOT(ISBLANK(related(D_contracten[Ingangsdatum]))) &&
NOT(ISBLANK(related(D_contracten[einddatum]))) &&
related(D_contracten[Ingangsdatum]) <= EindPeriode &&
RELATED(D_contracten[einddatum]) >= StartPeriode
),
DATEDIFF(
MAX(RELATED(D_contracten[Ingangsdatum]), StartPeriode),
MIN(related(D_contracten[einddatum]), EindPeriode),
DAY
) + 1
with this as result:
This is not what i want to see i want in each year the contract is active see the the days belong to dat year:
for example: key1:
in 2022: 1-8-2022 - 31-12-2022: 153 days
in 2023: 1-1-2023 - 31-12-2023: 365 days
in 2024: 1-1-2024 - 1-10-2024: 274 days
Thanks a lot for reaction!
Solved! Go to Solution.
Hi @Margreet as per the table that you have shared, create a disconnected year table like this
hi @techies , Yeah i am looking for the formula for that outcome... How did you do that?
Hi @Margreet as per the table that you have shared, create a disconnected year table like this
Hi @Margreet is this the year-wise breakdown you are looking for?
Thank!
Key | Productkey | Ingangsdatum | Einddatum |
1 | 10 | 1-8-2022 | 1-10-2024 |
2 | 11 | 1-12-2022 | 31-12-2022 |
3 | 8 | 1-12-2022 | 1-6-2023 |
4 | 10 | 1-3-2023 | 1-8-2023 |
5 | 11 | 1-3-2023 | 1-3-2024 |
6 | 22 | 1-3-2023 | 1-3-2025 |
Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.
Need help uploading data? click here
Want faster answers? click here
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
9 | |
7 |