Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Statement based on monthslicer

Hi all, 

 

I'm new with Power BI and queries. The situation is as folllowed:

 

I'm using the following measurement to calculate the cost per hire over a year.

CPH = SUM(Recruitmentchannel[cost])/Countrows(NewEmployees)

That works great, but if a click a month in the visualization. The calculation is wrong. So when i select a month i want the measurement to be like this: 

CPH = SUM(Recruitmentchannel[cost])/12/Countrows(NewEmployees) 

 

Does anyone know how to fix this problem? It would be much appreciated, cause it's for my final paper.

 

Cheers,

 

Kjell

  • CPH = IF(HASONEVALUE('Table'[Month]),SUM(Recruitmentchannel[cost])/12/Countrows(NewEmployees),SUM(Recruitmentchannel[cost])/Countrows(NewEmployees))

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    CPH = IF(HASONEVALUE('Table'[Month]),SUM(Recruitmentchannel[cost])/12/Countrows(NewEmployees),SUM(Recruitmentchannel[cost])/Countrows(NewEmployees))