Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi! I am able to get the percentage of the year that has elapsed with this Measure calculation:
Year Frac = YEARFRAC(DATE(YEAR(Data[Today]),1,1),Data[Today])
For today the result is 45.6%
What I want to do now is show the % of the quarter that has elapsed. Our Q1 is Jan-Mar etc.
How would I do this?
Ideally I would also have a slicer for the quarters and I would expect the see Q1 at 100% complete, and Q2 as 90% complete etc.
Thanks for your help!
Solved! Go to Solution.
Hi @ovanslyke,
In that case, you need a date table which contains a date column. Based on this date column, you should generate a quarter number column. Also, there should be a separate table containing a column that shows a list of Quarter number which will be added into a slicer later.
Date table =CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2017, 12, 31 ) ) Quarter Number = 'Date table'[Date].[QuarterNo]
Then, please create measures like below:
Totday date = TODAY() Current Quarter = ROUNDUP(MONTH(TODAY())/3, 0) Max date in selected quarter = CALCULATE ( MAX ( 'Date table'[Date] ), FILTER ( 'Date table', 'Date table'[Date].[Year] = YEAR ( TODAY () ) && 'Date table'[Quarter Number] = MAX ( Quarter[Quarter Number] ) ) ) Count days for quarter = CALCULATE ( COUNT ( 'Date table'[Date] ), FILTER ( 'Date table', 'Date table'[Date].[Year] = YEAR ( TODAY () ) && 'Date table'[Quarter Number] = MAX ( Quarter[Quarter Number] ) ) ) Date diff = IF ( [Totday date] >= [Max date in selected quarter], 1, IF ( [Current Quarter] < MAX ( Quarter[Quarter Number] ), 0, 1 - ( DATEDIFF ( [Totday date], [Max date in selected quarter], DAY ) / [Count days for quarter] ) ) )
Best regards,
Yuliana Gu
Hi @ovanslyke,
Have you worked it out now? If so, please kindly mark the corresponding reply as an answer so that it can benefit more pelple. If you still have any question, please feel free to ask.
Regards,
Yuliana Gu
Hi @ovanslyke,
In that case, you need a date table which contains a date column. Based on this date column, you should generate a quarter number column. Also, there should be a separate table containing a column that shows a list of Quarter number which will be added into a slicer later.
Date table =CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2017, 12, 31 ) ) Quarter Number = 'Date table'[Date].[QuarterNo]
Then, please create measures like below:
Totday date = TODAY() Current Quarter = ROUNDUP(MONTH(TODAY())/3, 0) Max date in selected quarter = CALCULATE ( MAX ( 'Date table'[Date] ), FILTER ( 'Date table', 'Date table'[Date].[Year] = YEAR ( TODAY () ) && 'Date table'[Quarter Number] = MAX ( Quarter[Quarter Number] ) ) ) Count days for quarter = CALCULATE ( COUNT ( 'Date table'[Date] ), FILTER ( 'Date table', 'Date table'[Date].[Year] = YEAR ( TODAY () ) && 'Date table'[Quarter Number] = MAX ( Quarter[Quarter Number] ) ) ) Date diff = IF ( [Totday date] >= [Max date in selected quarter], 1, IF ( [Current Quarter] < MAX ( Quarter[Quarter Number] ), 0, 1 - ( DATEDIFF ( [Totday date], [Max date in selected quarter], DAY ) / [Count days for quarter] ) ) )
Best regards,
Yuliana Gu
User | Count |
---|---|
103 | |
88 | |
78 | |
71 | |
69 |
User | Count |
---|---|
113 | |
99 | |
97 | |
72 | |
68 |