The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, i need help figuring this out. screenshot 1 is my excel source file and my main concern was for M124452. when i apply my formula (screenshot 2) everything works out including for M116572, but for some reason, M124452 keeps returning the previous department under "CBE Programs" instead of "Amex US" (screenshot 3). M116572's previous department is returning correct under "quest". for all records, only M124452 shows the incorrect previous department, and im out of ideas right now on how to fix this.
Screenshot1
Screenshot2
Screenshot3
Solved! Go to Solution.
The FILTER is returning a table with both of the M124452 rows and then you're taking the maximum over the two. Because you are taking the MAX of a text column, it's using alphabetical ordering and chooses CBE Programs since C comes after (is "greater than") A. Note that for M116572, Q > C, so you get "Quest".
There are lots of ways to approach this if you want to take the max by date rather than max alphabetically.
The FILTER is returning a table with both of the M124452 rows and then you're taking the maximum over the two. Because you are taking the MAX of a text column, it's using alphabetical ordering and chooses CBE Programs since C comes after (is "greater than") A. Note that for M116572, Q > C, so you get "Quest".
There are lots of ways to approach this if you want to take the max by date rather than max alphabetically.
I never knew it was it's purposes 😄 all of my codings came from ChatGPT as this is my first time doing PowerBI. I already got the gist of it and made a couple of formulas using Max, maybe because i was using it on numbers before. This is the first time i used it for Text. thanks for figuring this out 😄
additionally, i need the count of department so that is why i opted on this formula because it works. i might just need to tweak my questions to chatGPT to get the formula that i need.
ChatGPT isn't as good at DAX as other languages largely because DAX is so context-sensitive.
Brian Julius has some suggestions for improving things here:
https://www.linkedin.com/posts/brianjuliusdc_improve-chatgpts-dax-coding-abilities-with-activity-710...
User | Count |
---|---|
26 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
30 | |
14 | |
12 | |
12 | |
7 |