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.
Good day,
I have 1 table
with all my data from 2017. We have kits which we must implement on equipment within 9 months and I would like to calculate the number of Total kits and No of kits implemented on time for the last 9 months.
I tried a few formulas but am not getting the correct result.
Here is an example of my table
Date | Country | Kit Number | Equip No | Total | On-Time |
5 Sep 2019 | Turkey | 12456 | 90025 | 1 | 1 |
12 Dec 2019 | Turkey | 15692 | 90025 | 1 | 0 |
28 Dec 2019 | Egypt | 97523 | 90825 | 1 | 0 |
9 Jan 2020 | Egypt | 69725 | 90825 | 1 | 1 |
6 Feb 2020 | Turkey | 79652 | 90025 | 1 | 1 |
Solved! Go to Solution.
Hi @Susan_Colyn
try measures
Total kits =
CALCULATE(DISTINCTCOUNT('Table'[Kit Number]), DATESBETWEEN('Table'[Date], DATEADD(TODAY(), -9, MONTH), TODAY()) )
No of kits implemented =
CALCULATE(DISTINCTCOUNT('Table'[Kit Number]), DATESBETWEEN('Table'[Date], DATEADD(TODAY(), -9, MONTH), TODAY()), 'Table'[On-Time]=1)
Hi @Susan_Colyn
try measures
Total kits =
CALCULATE(DISTINCTCOUNT('Table'[Kit Number]), DATESBETWEEN('Table'[Date], DATEADD(TODAY(), -9, MONTH), TODAY()) )
No of kits implemented =
CALCULATE(DISTINCTCOUNT('Table'[Kit Number]), DATESBETWEEN('Table'[Date], DATEADD(TODAY(), -9, MONTH), TODAY()), 'Table'[On-Time]=1)
Hi @az38 Super User II
Thank you for the solution but I received an error with Dateadd, it seems you have to include a Field. I added a date field and it worked.
Thank you very much for your help.
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 |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |