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,
I am trying to create a calculated column in a table - based on counted distinct values that appear during the month - an example of the table is below:
Date | Unique value | Count requried |
31/01/2017 | A1 | 2 |
31/01/2017 | B2 | 1 |
31/01/2017 | A1 | 2 |
31/01/2017 | B3 | 1 |
31/01/2017 | B4 | 1 |
28/02/2017 | A1 | 2 |
28/02/2017 | A1 | 2 |
28/02/2017 | B2 | 2 |
28/02/2017 | B2 | 2 |
31/03/2017 | A1 | 1 |
31/03/2017 | B2 | 2 |
31/03/2017 | B2 | 2 |
31/03/2017 | C3 | 1 |
I have tried CALCULATE(DISTINCTCOUNT( UNIQUE VALUE , UNIQUE VALUE = UNIQUE VALUE, CALENDAR[DATE])
But i am just returned with the number rows in that month - rather than the count required column
Any help would be appreciated
Thanks,
Laurence
Solved! Go to Solution.
Hi @lmh100
Try this column
Count Required = CALCULATE ( COUNT ( TableName[Unique value] ), FILTER ( ALLEXCEPT ( TableName, TableName[Unique value] ), MONTH ( TableName[Date] ) = MONTH ( EARLIER ( TableName[Date] ) ) ) )
or this one
Count Required = CALCULATE ( COUNT ( TableName[Unique value] ), ALLEXCEPT ( TableName, TableName[Unique value], TableName[Date].[Month] ) )
If you just create a Table visualization and drop in your Date column, Unique Value column and then drop in your Date column again and switch the aggregation to Count you will achieve what you are looking for.
Hi @lmh100
Try this column
Count Required = CALCULATE ( COUNT ( TableName[Unique value] ), FILTER ( ALLEXCEPT ( TableName, TableName[Unique value] ), MONTH ( TableName[Date] ) = MONTH ( EARLIER ( TableName[Date] ) ) ) )
or this one
Count Required = CALCULATE ( COUNT ( TableName[Unique value] ), ALLEXCEPT ( TableName, TableName[Unique value], TableName[Date].[Month] ) )
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 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |