Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a scenario where I have an 'Accounts' table with four columns ( DB, AcctCode, AcctName, and ExpectedAcctCode ).
The problem is different 'AcctCode''s are there for the same 'AcctName' field.
The requirement is if there are multiple 'AcctCode's are there for the same 'AcctName', Min 'AcctCode' as per DB1 shall be returned in the 'ExpectedAcctCode' column.
Red colored fields are to be replaced with Yellow colored fields.
This is the sample dataset for your convenience: https://drive.google.com/file/d/1iKD-MMGbNAKmJ99w1WyM5JoRB9Kr0r5u/view?usp=sharing
Thanks in advace!
Cheers!
VKB
Solved! Go to Solution.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi,
Write this calculated column formula
Expected = calculate(min(Data[AcctCode]),filter(Data,Data[AcctName]=earlier(Data[AcctName])))
Hope this helps.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @VKB ,
Try this:
Measuree =
CALCULATE (
MIN ( Accounts[AcctCode] ),
FILTER (
ALL ( Accounts ),
Accounts[AcctName] = SELECTEDVALUE ( Accounts[AcctName] )
)
)
If this answer solves your problem, give it a thumbs up and mark it as an accepted solution so the others would find what they need easier.
Regards,
Loran
User | Count |
---|---|
98 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |