Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
Trying to add new column such that
IF datesbetween (2017,9,11), (2017,9,15)= "Proto1"
IF datesbetween (2017,9,18), (2017,9,22)= "Proto2"
IF datesbetween (2017,9,25), (2017,9,29)= "Proto3"
otherwise "null"
Can advice how can i write above in DAX? Should I be using IF or Filters?
Solved! Go to Solution.
Hi @vincentakatoh,
Try the following formula:
Proto =
SWITCH (
TRUE (),
'Calendar'[Date] >= DATE ( 2017, 9, 11 )
&& 'Calendar'[Date] <= DATE ( 2017, 9, 15 ), "Proto1",
'Calendar'[Date] >= DATE ( 2017, 9, 18 )
&& 'Calendar'[Date] <= DATE ( 2017, 9, 22 ), "Proto2",
'Calendar'[Date] >= DATE ( 2017, 9, 25 )
&& 'Calendar'[Date] <= DATE ( 2017, 9, 29 ), "Proto3",
BLANK ()
)Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @vincentakatoh,
Try the following formula:
Proto =
SWITCH (
TRUE (),
'Calendar'[Date] >= DATE ( 2017, 9, 11 )
&& 'Calendar'[Date] <= DATE ( 2017, 9, 15 ), "Proto1",
'Calendar'[Date] >= DATE ( 2017, 9, 18 )
&& 'Calendar'[Date] <= DATE ( 2017, 9, 22 ), "Proto2",
'Calendar'[Date] >= DATE ( 2017, 9, 25 )
&& 'Calendar'[Date] <= DATE ( 2017, 9, 29 ), "Proto3",
BLANK ()
)Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsWorks great. Thanks for introducing the "SWITCH" function. very useful function indeed.
Rgds, Vincent
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 130 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |