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.
Hello Community,
I created a calculated column to return 1 or 0 based on whether the date is within last 28 days. However, as you see from my screenshot below, it's showing all as 1. Below are all the DAX I'm using to populate this chart. Any pointer where I might have incorrectly implemented the formula?
[DateAxis] - date column format as DateTime
zLast28Days =
IF(
Data_RootTable_ChangeToYourSource[DateAxis] >= Data_RootTable_ChangeToYourSource[zMinDate] &&
Data_RootTable_ChangeToYourSource[DateAxis] <= Data_RootTable_ChangeToYourSource[zMaxDate]
, 1 , 0 )
zMaxDate = LASTDATE(Data_RootTable_ChangeToYourSource[DateAxis])
zMinDate = DATEADD(LASTDATE(Data_RootTable_ChangeToYourSource[DateAxis]),-28,DAY)
On a separate note - If I were to populate this "filtered last 28 day list" as a table, what's the best way to go about it?
Your help is appreciated.
Solved! Go to Solution.
I knew it shouldn't be that hard - firstnonblank, calculatetable - all those are not needed.
Fixed my own trouble simply by switching column to measure.
maxdate=lastdate(all('calendar'[lawcalendarfull]))
mindate=dateadd(lastdate(all('calendar'[lawcalendarfull])),-6,day)
last7=if(calendar[lawcalendarfull]>=calendar[lawmindate]&&calendar[lawcalendarfull]<=calendar[lawmaxdate],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 |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |