Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have a column added into my table which is using a datediff that says how many days between 2 dates ,
Age =datediff('Table1'[Date A],'Table 1'[Date 2],DAY)
However I am trying to create something that will say If the above Age column is over 7 days then use 7 (to sort of set 7 as a max value) and if the age is under 7 continue to use the original column, but nothing seems to be working!
As the datediff has been created in the table and doesn't appear in the advanced editor I can't do it as a conditional column.
One of the conditional columns I have used column doing something similar has something that would translate like this
Test =IF [#"Age"] > 7.001,then "7" else [#"Age"])
But that didn't work.
Any help would be appreciated.
Thanks
Solved! Go to Solution.
Hi @Anonymous
if you use DAX calculated column your new column will look like
Test = MIN([Age], 7)
you also can use this technique
Age =
var _dd = datediff('Table1'[Date A],'Table 1'[Date 2],DAY)
RETURN
IF(_dd < 7, 7, _dd)
Hi @Anonymous
if you use DAX calculated column your new column will look like
Test = MIN([Age], 7)
you also can use this technique
Age =
var _dd = datediff('Table1'[Date A],'Table 1'[Date 2],DAY)
RETURN
IF(_dd < 7, 7, _dd)
The first one seems to have worked perfectly, thank you.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
68 | |
41 | |
35 |
User | Count |
---|---|
107 | |
56 | |
52 | |
48 | |
40 |