The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi
I'm still a relative newbie to Power BI so please excuse if this is simple - I just can't get my head around what I need to do.
I have a database based on offending. I have an offence table which has a person ID, offence type and offence date. I have also created columns for Year and Quarter (fiscal) based on the offence date.
A person can only have one offence per quarter but can appear in every quarter.
I need my chart to count the number of offences by offence type based on the slicer selection. If I select Quarter, this is fairly straightforward as the number of offences is the same as the number of people. However, if I select year, I only want the chart to count the earliest offence date for each person. I've tried creating a firstdate measure for the offence date but didn't know what to do with it once I had! Any advice would be great. Thank you!
A very simplified example of data below:
Solved! Go to Solution.
Change it to the following measure, measure only considers the current row context, you must set it to ALl(table).
Change it to the following measure, measure only considers the current row context, you must set it to ALl(table).
What does the measure you've written look like?
Also, it's good practice to create a Calendar table for data like this. You can create a relationship between DateOffence and date in the calendar table. Then create the Quarter, Year fields etc in the Calendar table (and not in the Fact table as shown)
It's just a basic
User | Count |
---|---|
71 | |
65 | |
62 | |
50 | |
28 |
User | Count |
---|---|
117 | |
75 | |
61 | |
54 | |
42 |