Forum Discussion
trouble with calculated column
Hello,
First sorry for my english.
I'm a very newby on powerBI but everything becom with a start no ?
I've a table with some column :
- [first] date for when the holiday start ,
- [second] date for when the holiday finish
- [third] who calculate the the day between this two date expect unwork day and weekend, with DAX function (working at this point)
- [forth]one with 3 value (day, amp, pm)
everything is fine but I want to create an other colunn [Five] who say " if [forth} ="day", [Five] = [Third] else [Five] = 0,5 "
For that I've try this :
Do you have an idea to help me ?
Thank you very mush
Hey dorsey ,
that usually happens when you mix data types.
I guess [third] is number, no? Then try it like this:
Colonne = IF( [forth]="day", [third], 0.5)If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
4 Replies
- dorseyRegular Visitor
Hello,
and thank you for your two help. It's working and it's awsome !!
Nothing for you maybe but for me it's a big start !
regards
- HotChilli
Community Champion
the 2 return paths of an IF statement have to return the same datatype. It looks like the code returns an integer or a string so that's what you need to fix.
- selimovd
Most Valuable Professional
Hey dorsey ,
that usually happens when you mix data types.
I guess [third] is number, no? Then try it like this:
Colonne = IF( [forth]="day", [third], 0.5)If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic