Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone! I have an issue here,
i have a column in which i have transformed a number string in date (AT_FECREM_NEW)
and then another column that makes the datediff between that day and today.
The thing is that i want to group those results in 4 groups:
- 0-30 days
- 30-60 days
- 60-90 days
- more than 90 days
I'm doing this in this way but im finding an error
When i make the calculated column with if, it tells me that cant use Variant data type to define calculated columns, can someone help me? I tried using PQuery but in there there are not shown the columns that i create with DAX.
Solved! Go to Solution.
Hi, @feralvarez994
Maybe you can try to carry out one more step.
Column:
Group =
IF([Dias]>90,1,IF([Dias]>60,2,IF([Dias]>30,3,IF([Dias]>0,4,0))))
Column =
IF([Group]=1,">90",IF([Group]=2,"60-90",IF([Group]=3,"30-60",IF([Group]=4,"0-30","0"))))
Is this the output you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @feralvarez994
Maybe you can try to carry out one more step.
Column:
Group =
IF([Dias]>90,1,IF([Dias]>60,2,IF([Dias]>30,3,IF([Dias]>0,4,0))))
Column =
IF([Group]=1,">90",IF([Group]=2,"60-90",IF([Group]=3,"30-60",IF([Group]=4,"0-30","0"))))
Is this the output you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi! This works, thanks you a lot!
Hi,
Can you check the Data type of your calculated column [Dias C antiguidad] ?
It might not be a type numeric (whole number, or Decimal value or fixed decimal value).
To change type, select your column in field panel, then go to Column Tools tab et choose a numric data type and choose your format as well.
Tell us if it works after changing the type ?
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 |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
9 |