Forum Discussion
arifulice09
4 years agoHelper I
Power BI calculated column Help
I have a data table (see the attached) , I am trying to get a calculated column based on some condition Condition( if all FeeType is Hourly for a particular project then for that project the result...
- 4 years ago
Hi arifulice09 ,
Create a column like this:-
Column_ = var _hourly = COUNTROWS(FILTER('Table (3)','Table (3)'[Feetype] = "Hourly" && 'Table (3)'[projectid] = EARLIER('Table (3)'[projectid]))) var _nobill = COUNTROWS(FILTER('Table (3)','Table (3)'[Feetype] = "NoBilling" && 'Table (3)'[projectid] = EARLIER('Table (3)'[projectid]))) var _proj = COUNTROWS(FILTER('Table (3)','Table (3)'[projectid] = EARLIER('Table (3)'[projectid]))) return SWITCH(TRUE(), _hourly = _proj ,"Hourly", _nobill = _proj,"No Biling", "Fixed")Output:-
Thanks,
Samarth
Samarth_18
4 years agoCommunity Champion
Hi arifulice09 ,
Create a column like this:-
Column_ =
var _hourly = COUNTROWS(FILTER('Table (3)','Table (3)'[Feetype] = "Hourly" && 'Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
var _nobill = COUNTROWS(FILTER('Table (3)','Table (3)'[Feetype] = "NoBilling" && 'Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
var _proj = COUNTROWS(FILTER('Table (3)','Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
return SWITCH(TRUE(),
_hourly = _proj ,"Hourly",
_nobill = _proj,"No Biling",
"Fixed")Output:-
Thanks,
Samarth
arifulice09
4 years agoHelper I
Samarth_18 thank you :-), its working fine.