Hi!
I am trying to filter my Sum calculation with two different columns in my UnitCategory table.
1st column : [isSelfPropelled] which is True () for sedans, trucks, etc.
2nd column : [VehiculeCategory] which is a code that describe every type of vehicule or equipment
Here is what I have in mind but that obviously doesn't work.
NumVehiculeEquivalents:=Calculate(
Sum(factVehiculeRental[VehiculeEquivalents]);
dimCalendar[isCurrentYear] = True(); dimUnitCategory[isSelfPropelled]=True()||dimUnitCategory[VehiculeCategory]="2"||dimUnitCategory[VehiculeCategory]="3"
)
The "2" and "3" mean snow removal equipment and they are not self-propelled. So, I want the total of vehicule equivalents for self-propelled and snow removal equipment.
I encounter this kind of issue quite frequently in other cases. I can get around this problem by adding a calculated column in my dimension table but I would like to find an easier way to solve this.
In this example, I would add a new column in dimUnitCategory with a combination of If() and put that column in the Calculate().
I could also create 1 measure for the self-propelled, an another one for the snow removal equipment and a final one that sums both but I would like something simpler.
Maybe that can't be done but it is worth asking
Thank you!!!
I am trying to filter my Sum calculation with two different columns in my UnitCategory table.
1st column : [isSelfPropelled] which is True () for sedans, trucks, etc.
2nd column : [VehiculeCategory] which is a code that describe every type of vehicule or equipment
Here is what I have in mind but that obviously doesn't work.
NumVehiculeEquivalents:=Calculate(
Sum(factVehiculeRental[VehiculeEquivalents]);
dimCalendar[isCurrentYear] = True(); dimUnitCategory[isSelfPropelled]=True()||dimUnitCategory[VehiculeCategory]="2"||dimUnitCategory[VehiculeCategory]="3"
)
The "2" and "3" mean snow removal equipment and they are not self-propelled. So, I want the total of vehicule equivalents for self-propelled and snow removal equipment.
I encounter this kind of issue quite frequently in other cases. I can get around this problem by adding a calculated column in my dimension table but I would like to find an easier way to solve this.
In this example, I would add a new column in dimUnitCategory with a combination of If() and put that column in the Calculate().
I could also create 1 measure for the self-propelled, an another one for the snow removal equipment and a final one that sums both but I would like something simpler.
Maybe that can't be done but it is worth asking
Thank you!!!