Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
jusTodd
Advocate IV
Advocate IV

Calculate column based on Yes/No living another Table column

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)

DrillJanFebMarAprMay

Jun

Bomb Threat10010

0

Fire Drill11111

1

Tornado01010

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.

2 REPLIES 2
Anonymous
Not applicable

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 NameJune July 
Idv-ProgCount of Drill TypeCount of ExpectedDrillsCount of Drill TypeCount of ExpectedDrillsCount of Drill TypeCount of ExpectedDrillsCount of Drill TypeCount of ExpectedDrills
AlBo-L43134393
AlLu-L33234393
AlPa-W234343103
AmBu-L432353113
AnMo-W13334383
AnWa-R13334383
AnWe-F13134363
AnWh-V23334393
AnZa-N  234363
ApWo-W13335393
ArBa-A    4343
AsTu-W13334383

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.