Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
As with most others here, I seem to have a straightforward problem that I have researched to death. Nothing I try seems to work.
Am a bit of newbie to this whole DAX / M thing and am really struggling with this one and any help would be greatly appreciated.
One table identifies he number of drills expected for each month.
(Example)
Drill | Jan | Feb | Mar | Apr | May | Jun |
Bomb Threat | 1 | 0 | 0 | 1 | 0 | 0 |
Fire Drill | 1 | 1 | 1 | 1 | 1 | 1 |
Tornado | 0 | 1 | 0 | 1 | 0 | 1 |
I easily have the sum of each of these months, but need to reduced that number by 1, for any particular month, if the location has no staff on site overnight.
Overnight Staff is identified in another table with a simple Yes/No
Basically, If No Overnight Staff, reduce the number of expected drills by 1
Again, thanks in advance to anyone that can shine light on this.
Hi @jusTodd ,
I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting.
Thanks for your efforts & time in advance.
Best regards,
Community Support Team_ Binbin Yu
Thanks for your reply! This is a bit messy. I made a little more headway with my data, and hopefully this post will clarify the situation.
From the output table below,
In June, AlPa-W performed 2 Drills (TableA), but was expected to do 3 (TableB), causing a completion rate of 66%.
/ usingRAW Completion =DIVIDE(COUNT('TempData'[Drill Type]),DISTINCTCOUNT('Drill_by_Month'[ExpectedDrills]))
No problem so far, however, that location has no Overnight Staff (identified in TableA field as Yes/No)
Since one of the drills is expected overnight, for that location and all that are "No", I need to reduce the expected number to 2 to give me a completion rate for those sites of 100%
Count of Drill Type is a count
Count of Expected is a distinct count
Month Name | June | July | ||||||
Idv-Prog | Count of Drill Type | Count of ExpectedDrills | Count of Drill Type | Count of ExpectedDrills | Count of Drill Type | Count of ExpectedDrills | Count of Drill Type | Count of ExpectedDrills |
AlBo-L | 4 | 3 | 1 | 3 | 4 | 3 | 9 | 3 |
AlLu-L | 3 | 3 | 2 | 3 | 4 | 3 | 9 | 3 |
AlPa-W | 2 | 3 | 4 | 3 | 4 | 3 | 10 | 3 |
AmBu-L | 4 | 3 | 2 | 3 | 5 | 3 | 11 | 3 |
AnMo-W | 1 | 3 | 3 | 3 | 4 | 3 | 8 | 3 |
AnWa-R | 1 | 3 | 3 | 3 | 4 | 3 | 8 | 3 |
AnWe-F | 1 | 3 | 1 | 3 | 4 | 3 | 6 | 3 |
AnWh-V | 2 | 3 | 3 | 3 | 4 | 3 | 9 | 3 |
AnZa-N | 2 | 3 | 4 | 3 | 6 | 3 | ||
ApWo-W | 1 | 3 | 3 | 3 | 5 | 3 | 9 | 3 |
ArBa-A | 4 | 3 | 4 | 3 | ||||
AsTu-W | 1 | 3 | 3 | 3 | 4 | 3 | 8 | 3 |