The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I'm trying create a column using a numeric field based on the value of a non-numeric column. I'm using An IF Statement as follows:]
@Anonymous Strange. Worked flawlessly for me. See attached PBIX below signature. You should at least get the original Hour column values. I would also recommend switching over to using a SWITCH(TRUE(),...) statement to avoid nested IF statements.
Greetings again, Greg! Was finally able to get the results that I needed. It came from a colleague where I work. First off, there were several issues with my data:
Providing the final result:
I hope this helps anyone else that may need such a solution.
Greg, thanks again for giving it a go!
Best regards,
Marty
Greetings and Happy St. Patty's Day, Greg. So I created a test data sample of my own and put it into PowerBI and was not able to get it to work. Unfortunately, I don't have the option to attach a file or I would include the .xlsx test data and .pbix file. Here's a screen shot of the data in the .xlsx file:
and a screen shot of the table in .pbix:
Associated DAX Code:
Here's the results I get:
😞
Yes, very interesting. It's not working for me at all. I also tried using SWITCH to not have to do two separate columns and IF statements, but that also didn't work. When I tried to open your file, it says I'm using an old version of Power BI and need to update. That may be the problem right there. Will update and retry and will let you know. Thanks for your help, Greg!
User | Count |
---|---|
80 | |
78 | |
37 | |
34 | |
31 |
User | Count |
---|---|
93 | |
81 | |
60 | |
49 | |
49 |