Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Team,
I want a dax syntax in which column A is sorted Alphabetically.
Column C and Column D are checked or looked up in column A and if that match is found then in the result earlier alphabetical value is taken first followed by the next.
I have written the formula in Excel.
Please see the attached picture for reference.
Thank you!
Solved! Go to Solution.
Hi @Unknown_1 ,
Thanks for the reply from @123abc , please allow me to provide another insight:
Creating Calculated Columns, Writing Expressions
Result =
IF (
MIN ( [LE], [COUNTER LE] ) & MAX ( [LE], [COUNTER LE] ) = [LE] & [COUNTER LE],
[LE] & [COUNTER LE],
MIN ( [LE], [COUNTER LE] ) & MAX ( [LE], [COUNTER LE] )
)
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Unknown_1 ,
Thanks for the reply from @123abc , please allow me to provide another insight:
Creating Calculated Columns, Writing Expressions
Result =
IF (
MIN ( [LE], [COUNTER LE] ) & MAX ( [LE], [COUNTER LE] ) = [LE] & [COUNTER LE],
[LE] & [COUNTER LE],
MIN ( [LE], [COUNTER LE] ) & MAX ( [LE], [COUNTER LE] )
)
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey,
How to solve the same problem when my COUNTER LE is in a different table.
Please help me with that.
Thank you!
My specific Requirement is :
I want distinct values from Column Counter BU and Legal Entity and store those values alphabetically in a new column or table.
Post that I want to check Counter BU and Legal Entity in the newly created table/Column and return the Alphabetically earlier value taken first.
I hope this helps.
To sort a column alphabetically in DAX, you would typically use the ORDER BY function within a SUMMARIZE or SELECTCOLUMNS function. Here's a simple example:
SortedTable =
SORT(
TableName,
TableName[ColumnA], ASC
)
This code will sort the table "TableName" based on the values in "ColumnA" in ascending order.
For the lookup operation you described, you can use DAX functions like RELATED or LOOKUPVALUE. Here's a basic example:
LookupResult =
SELECTCOLUMNS(
TableName,
"ColumnA", TableName[ColumnA],
"MatchedColumnC", LOOKUPVALUE(TableName[ColumnC], TableName[ColumnA], TableName[ColumnA]),
"MatchedColumnD", LOOKUPVALUE(TableName[ColumnD], TableName[ColumnA], TableName[ColumnA])
)
This code will create a new table with columns "ColumnA", "MatchedColumnC", and "MatchedColumnD", where "MatchedColumnC" and "MatchedColumnD" are looked up based on the value in "ColumnA".
You can adjust these examples to suit your specific needs and integrate them into your DAX formula. If you provide more details about your specific requirements, I can tailor the code accordingly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |