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.
I am new in Power BI. I want to perform very basic calculation, where i'll check
Calc1 =
if no>=200 then good
else if no >500 Very Good
else if no >=100 AND <200 then bad
END
once that is done, then I want calculate no. of bad and good like below
calc2 =
if calc1="bad" then count(bad)
else if calc1 = "Good" then count (Good)
else calc1 = "very Good" then count(Very Good)
END
This no. which I have mentioned is nothing but difference between dates in day
DATEDIFF(craetedate,today(),day)
but this is calculated column which I made from a date column.
Now as it's a column i cannot pull it in calculated measure. But to do the aggregation like count I need to pull this column in measure which is not happening. And calc1 is also in calculated column.
What should I do? This is taking much longer than i though.
Any help would be appreciated.
Thank you,
Bhavana
Solved! Go to Solution.
Hi @Bhavana_k,
It looks like you want to use the calculated column ( Column= DATEDIFF(craetedate,today(),day) ) in a measure, right?
You can use the aggregate functions eg: COUNT, SUM, MAX,..,etc.
You can go through these links to learn more about how to create measures:
https://docs.microsoft.com/en-us/power-bi/desktop-measures
https://docs.microsoft.com/en-us/power-bi/desktop-tutorial-create-measures
Best Regards,
Qiuyun Yu
Hi @Bhavana_k,
It looks like you want to use the calculated column ( Column= DATEDIFF(craetedate,today(),day) ) in a measure, right?
You can use the aggregate functions eg: COUNT, SUM, MAX,..,etc.
You can go through these links to learn more about how to create measures:
https://docs.microsoft.com/en-us/power-bi/desktop-measures
https://docs.microsoft.com/en-us/power-bi/desktop-tutorial-create-measures
Best Regards,
Qiuyun Yu
Hi @v-qiuyu-msft ,
Thank you, it helped me. 🙂
This is what I did, I just want to others if they come across same problem.
I have a column which gets difference between two dates lets say day_diff_no= DATEDIFF(createddate,today(),'day')
I have set data type of this column to whole number.
Now another new measure I made from your help which is CheckCategory and this is what I wrote
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 |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |