Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a table similiar to the below:
DateTimeRecieved | Subject | Folder |
01/01/2022 | Red | Square |
23/01/2022 | Blue | Circle |
28/01/2022 | Red | Square |
03/02/2022 | Red | Square |
15/02/2022 | Green | Triangle |
I want to count the distinct subjects per month but only count the first occurence of the subject with the month it was recieved. I.e. Count 'Red' as 1 and only show it when I filter the month to January (If the month was filtered to Feb do not include red in the coutn of subject)
This data will be represented in a bar graph showing 'Number of subjects' by 'Folder' This graoh can then be filtered by month of DateTimeReceived
Thanks
@amitchandak - Thanks for the response.
Is the 'Month Year sort' column to be a seperate column from 'Month Year'?
When I try to write both these DAX in the same column I receive a syntax error.
Thanks
@TG_12 , 2 separate columns
How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c
@amitchandak - Appreciate your assistance here and thank you for sharing that vid on sort columns - very informative!
Unfortunately when using this solution the measure will still count the unique subject as '2' as it appears in 2 months.
E.g. using the following example the measure will count 'Red' in both Jan and Feb when I would only like to count 'Red' in Jan as that is when it first appeared
Month Year | Subject |
Jan-2021 | Red |
Jan-2021 | Red |
Feb-2021 | Red |
The ideal scneario from this data example would be a count that shows the total unique subjects being = 1 which can then be filtered by month to show Jan-2021 = 1 & Feb-2021 = 0
fJust to follow the subject
@TG_12 , create a month year column and then create meausre
column
Month Year = FORMAT([Date],"mmm-yyyy")
Month Year sort = FORMAT([Date],"yyyymm")
measure =
countrows(Summarize(Table, Table[month], Table[Subject]))
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
79 | |
58 | |
35 | |
34 |
User | Count |
---|---|
99 | |
59 | |
56 | |
46 | |
40 |