Forum Discussion
If statement on a Boolean type (Measure)
Hey everyone!
I have a column that has a type of TRUE and FALSE (Boolean) and I am trying to make a measure that just outputs all the true values
I have a a column like so;
Time tracked | IsBillable
3 TRUE
6 TRUE
4 False
And I want a measure that only selects all the TRUE so I can eventually have a graph that compares Billable vs non-billable like so:
Can anyone help me to make this measure or advice on another way to do so? So far I have come up with:
- BillableTRUE = IF(COUNTX('TimeExport (3)'[IsBillable] = true) sum('TimeExport (3)'[TimeTracked]), 0)
5 Replies
- parry2kSuper User
Anonymous why not create stacked bar chart and put Is Billable column on Legend and Time Tracked on values, it will do it.
- AnonymousNot applicable
I see that did the job! Is there a way to change the legend labels from True and False to Billable and Non-billable?
- parry2kSuper User
Anonymous add a custom column in your model to get that label and use that on legend
Legend = IF ( Table[Is Billable], "Billable", "Non-Billable" )Would appreciate if you give Kudos if my solution helped.