Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
To convert the following tableau calculated field to Power BI Dax, which I faced issue while doing this.
STR(if year(TODAY()) = year([Calender]) and month(TODAY())= MONTH(Calender]]) then 1
elseif year(TODAY()) = year(Calender]) and
(month(TODAY())- MONTH(Calender])) >=0 then 1
elseif year(TODAY())-1 = year(Calender]) and
(month(TODAY())- MONTH(Calender])) < 0 then 1
else 0 end)
Help with this is really appreciated.
Thanks in advance
Solved! Go to Solution.
@asdf1608 ,Assuming calendar is name of date column, a new column like
Switch( True() ,
year(TODAY()) = year([Calender]) && month(TODAY())= MONTH(Calender]]), 1
year(TODAY()) = year(Calender]) && (month(TODAY())- MONTH(Calender])) >=0 ,1
year(TODAY())-1 = year(Calender]) && (month(TODAY())- MONTH(Calender])),1,0)
@asdf1608 ,Assuming calendar is name of date column, a new column like
Switch( True() ,
year(TODAY()) = year([Calender]) && month(TODAY())= MONTH(Calender]]), 1
year(TODAY()) = year(Calender]) && (month(TODAY())- MONTH(Calender])) >=0 ,1
year(TODAY())-1 = year(Calender]) && (month(TODAY())- MONTH(Calender])),1,0)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
22 | |
12 | |
8 |
User | Count |
---|---|
76 | |
50 | |
46 | |
16 | |
12 |