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 September 15. Request your voucher.
I would like to get the number of active contracts on two specific selected dates in a date slicer. Based on a suggestion from radacad, Power BI From and To Date Filtering with One Slicer - RADACAD I have created two measures on contract table DatoStart and DatoSlutt (end). The date table is without relationship. KONTRRETUR is start date of contract. KONTROPPSEIINGDATO is end date.
The result is correct as shown below.
To get the total numbers for first date the following create the following measure:
Solved! Go to Solution.
Hi @JonGunnar
Thanks for reaching out to us.
>>to count total active contracts on two selected dates
Please try this, create the 3 measures below,
selectedStart=minx(allselected('Date'),[date])
selectedEnd=maxx(allselected('Date'),[date])
count= calculate(countrows('Fact'),filter(all('Fact'),'Fact'[start date]>=[selectedStart] && 'Fact'[end date]<=[selectedEnd]))
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @JonGunnar
Thanks for reaching out to us.
>>to count total active contracts on two selected dates
Please try this, create the 3 measures below,
selectedStart=minx(allselected('Date'),[date])
selectedEnd=maxx(allselected('Date'),[date])
count= calculate(countrows('Fact'),filter(all('Fact'),'Fact'[start date]>=[selectedStart] && 'Fact'[end date]<=[selectedEnd]))
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.