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.
I have a table with below fields. I need to find out the count of projects which starts in current year which is 2021. I need to consider the rows only with valid year values.
Project Name Start End
Project 1 Q12020 Q42023
Project 2 Q32021 Q42025
Project 3 Q12022 Q12025
Project 4 Junkdata Junkdata
Please help with dax for creating measure.
Solved! Go to Solution.
Hi @Ramees_123 ,
Try this measure. Because there is a possibility that the project name will be repeated, the DISTINCTCOUNT is repeated.
Distinctcount project =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Project Name] ),
FILTER (
'Table',
[Start] <> "Junkdata"
&& VALUE ( RIGHT ( 'Table'[Start], 4 ) ) = YEAR ( TODAY () )
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Ramees_123 ,
Try this measure. Because there is a possibility that the project name will be repeated, the DISTINCTCOUNT is repeated.
Distinctcount project =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Project Name] ),
FILTER (
'Table',
[Start] <> "Junkdata"
&& VALUE ( RIGHT ( 'Table'[Start], 4 ) ) = YEAR ( TODAY () )
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
= COUNTROWS( FILTER( PROJ, RIGHT( PROJ[Start], 4 ) = "2021" ) )
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
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 | |
100 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |