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 a single table with 2 date fields:
Report Date Created on Count
01/03/2019 | 10/03/2019 | Y |
01/03/2019 | 06/05/2015 | N |
01/04/2019 | 04/08/2016 | N |
01/04/2019 | 20/04/2019 | Y |
01/04/2019 | 05/04/2019 | Y |
The logic I need is: Count IF "Created On" Month and Year = "Report date" Month and Year.
What is the best method of creating this?
Thank you in advasnce for any help.
Moby
Solved! Go to Solution.
Hi @Anonymous
You may create a column like below and then create a measure to get the count.
Column = IF ( MONTH ( 'Table'[Report Date] ) = MONTH ( 'Table'[Created On] ) && YEAR ( 'Table'[Report Date] ) = YEAR ( 'Table'[Created On] ), "Y", "N" )
Measure = COUNTROWS ( FILTER ( 'Table', NOT ( 'Table'[Analysis] ) IN { "CLSD" } ) )
Regards,
Update: I have managed to get to this point by adding 2 columns which format the date into year and month:
Now I just need to figure out how to write the IF statement to compare the 2 dates and count all rows not including "CLSD".... I'm still struggling, so I would appreciate any help.
This Calcualted colunm will give you a 1 or a 0 based on the two dates
you can then sum this colunm as a measure to get what your after
Proud to be a Super User!
Hi @Anonymous
You may create a column like below and then create a measure to get the count.
Column = IF ( MONTH ( 'Table'[Report Date] ) = MONTH ( 'Table'[Created On] ) && YEAR ( 'Table'[Report Date] ) = YEAR ( 'Table'[Created On] ), "Y", "N" )
Measure = COUNTROWS ( FILTER ( 'Table', NOT ( 'Table'[Analysis] ) IN { "CLSD" } ) )
Regards,
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 |
---|---|
109 | |
99 | |
83 | |
76 | |
65 |
User | Count |
---|---|
120 | |
108 | |
95 | |
83 | |
77 |