Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello All!
I have a file of weekly data snapshots. The file has a snapshot date stamp
I have a measure:
headcount_Max_Wk = CALCULATE(DISTINCTCOUNT(SNAP_DWH_RES_RESOURCE[resource_key]),LASTDATE(SNAP_DWH_RES_RESOURCE[snaphot_stamp]))
The idea is i get a distinct count based on the latest date. When you create a bar chart and show the data by business area and year/month it correctly shows the headcount... and i can see its taking the last date for the month and giving the correct distinct headount
However on a second visual, where the bar chart is showing job role and year/month it doesnt work correctly... its overcounting this seems to be because some people have changed their job from 1 week to another, in the same month. As you can see below Name_2 and Name_3 are examples... how do i change my measure to ignore the 1st October row of data for each?
Cheers
Andy
@andybamber Hi , You can use this formula . I took employee Column to get distinct count by month .
@Anonymous thanks for your reply... Apart from using Employee field in stead of resource Key (which is effectively the unique employee ID) your measure is probably the same as mine... i think maybe you require some additional information... so the Month is being pulled into the visual from the linked Date Dimension table, the join is from snapshot date stamp to the data.. does that help?
Cheers
Andy
@andybamber : It Will Work for that as well . you have to define BI Directional Relationship in between datetable and your master table then it will work fine for you .
@Anonymous its currently set as both....
@andybamber Can you please sample file with relevant data and kindly mask other columns.It will be great .
@Anonymous i should also have said regarding the PBIX that the right hand bar chart is correctm showing 8 for both months, but its the one on the left with the actual role where its not counting correctly... thanks
@Anonymous I have a file for you, how do i send as it wont let me attach a PBIX into a message....
Cheers
Andy
For each Employee and Month Name you want to find the latest Day of the month. Once you have that you can then lookup the Job role for that user for that date.
Do you need to do this in DAX or is Power Query an option too?
Hi There!
Dax would be the preferred option, but i'm open to a power query solution..
Cheers
Andy
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
10 | |
10 | |
9 |
User | Count |
---|---|
15 | |
13 | |
12 | |
11 | |
10 |