Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
navedkhan
Helper III
Helper III

Help Required - Identify Highest Values in a row and return Column Header into another column name

Hi Friends - am looking for a help with the below sample data;

 

DateTeam0-2 days3-5 days>5 daysAgeing Band
01 09 2020ABC102560>5 days
02 09 2020XYZ015103-5 days
03 09 2020STC201310-2 days

 

My requirement is as follows;

1) To identify Highest values in a given row and return corresponding Column Header name into another calculated column named 'Ageing Band'

 

Please can you help me with DAX for this calculated column?

 

3 REPLIES 3
negi007
Community Champion
Community Champion

@navedkhan You can achive your result using power query as well like below

 

Step 1. 

negi007_1-1600926962826.png

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjBUMLBUMDIwMlDSUXJ0cgaShiCmkSmQMAOxYkoNDIxTTRVSEiuLlWJ1gFqMkLREREYBSRDL0BSm11gXWbUxkurgEJAFYKahMYgA6dU1gqqOBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Team = _t, #"0-2 days" = _t, #"3-5 days" = _t, #">5 days" = _t, #"Ageing Band" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Team", type text}, {"0-2 days", Int64.Type}, {"3-5 days", Int64.Type}, {">5 days", Int64.Type}, {"Ageing Band", type text}}),
#"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"0-2 days", "3-5 days", ">5 days"}, "Attribute", "Value")
in
#"Unpivoted Only Selected Columns"

 

Step 2: Use Matrix visual like below

 

negi007_2-1600927055848.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Anonymous
Not applicable

Hey, you could give a try to this

 

Ageing band =
if(calculate(sum([0-2 days])) > calculate(sum([3-5days])) && calculate(sum([0-2 days])) > calculate(sum([>5days])), ">5 days", 

if(calculate(sum([3-5 days])) > calculate(sum([0-2days])) && calculate(sum([3-5days])) > calculate(sum([>5days])), "3-5 days",

"0-2 days"))

amitchandak
Super User
Super User

@navedkhan , Create a new column like

 

switch( true() ,
[0-2 days] > [3-5 days] && [0-2 days] > [>5 days] , "0-2 days",
[3-5 days]> [>5 days] , "3-5 days",
">5 days"
)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.