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.
Hi All,
I have created 2 measures -
1) YTD Counts - which shows activity counts for currect year (2022)
2) YTD Counts for Last Year - which shoes activity counts for last year
Solved! Go to Solution.
Hi, @Anonymous ;
You could create a mesure to calculate count.
Count =
IF (
MONTH ( MAX ( [Activity Submission Date and time] ) ) = MONTH ( TODAY () ),
CALCULATE (
COUNT ( [Activity Id] ),
FILTER (
'Activity details',
[Activity Submission Date and time]
<= DATE ( YEAR ( [Activity Submission Date and time] ), MONTH ( TODAY () ), DAY ( TODAY () ) ))),
COUNT ( [Activity Id] ))
and Percentage as follows:
Percentage =
var _last= SUMX(FILTER(ALL('Activity details'),EOMONTH([Activity Submission Date and time],0)=EOMONTH(MAX([Activity Submission Date and time]),-12)),[Count])
return DIVIDE([Count]-_last,[Count])
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
You could create a mesure to calculate count.
Count =
IF (
MONTH ( MAX ( [Activity Submission Date and time] ) ) = MONTH ( TODAY () ),
CALCULATE (
COUNT ( [Activity Id] ),
FILTER (
'Activity details',
[Activity Submission Date and time]
<= DATE ( YEAR ( [Activity Submission Date and time] ), MONTH ( TODAY () ), DAY ( TODAY () ) ))),
COUNT ( [Activity Id] ))
and Percentage as follows:
Percentage =
var _last= SUMX(FILTER(ALL('Activity details'),EOMONTH([Activity Submission Date and time],0)=EOMONTH(MAX([Activity Submission Date and time]),-12)),[Count])
return DIVIDE([Count]-_last,[Count])
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
Can you post sample data as text and expected output?
Not enough information to go on;
Best Regards,
Community Support Team_ Yalan Wu
SAMEPERIODLASTYEAR() does not give you what you think it does. You need to add the YTD restriction yourself, otherwise it will return full periods.
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Please show the expected outcome.
Dear @v-yalanwu-msft @lbendlin
My Apology for replying so late as was travelling.
sameperiodlastyear is giving entire feb month counts but that should calculate till 18th Feb only (as of today's date) and due to this my % Increament calculation is getting wrong.
Desired Result is in green color below
Attaching data with you. Please download from below link.
Thanks a lot in advance.
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 |
---|---|
114 | |
98 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |