Forum Discussion

apai1990's avatar
apai1990
Frequent Visitor
2 years ago

Help on Context filter

Hello, 

 

I'm migrating the Tableau dashboard to Power BI, data does not seem to match for the same period. After some digging in the Tableau dashboard, I found there were 13 unique EMP IDs but in Power BI there are 17. On further inspecting I found the Tableau period filter is in context and if I remove the period filter from context my number matches with that of Power BI.

So the period filter in Power BI I'm using is not working as it should as a context filter, as far as I know, all the filter in Power BI works on a contextual basis.

I need to know where I'm going wrong.

 

My data consists of EMP IDs with average pay against them, I'm also applying another filter named as "Global Condition-Hours" to filter out EMP IDs whose total working hours are less than 1600.

 

The formula for Global Condition-Hours and Average pay is below:

 

 

Global Condition-Hours = CALCULATE(SUM('Final Table'[Total Hours]), FILTER(ALLEXCEPT('Final Table','Final Table'[Emp Id]),'Final Table'[Time Range]))>=1600

 

 

 

 

 

Avg. Pay = SUM('Final Table'[Total Compensation])/DISTINCTCOUNT('Final Table'[Emp Id])

 

 

 

Screenshot for Power BI:

 

 Screen Shot from Tableau (here in Tableau the period filter is named "Time Range")

 

I think I should include the period filter in Global Condition-Hour & avg pay, but I'm not successful in doing so,

any help will be highly appriciated