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
Tarunika
Helper II
Helper II

Get a value based on the condition from another column

Hi all ,

Below is the sample data i want to take only those ID_meter for which the Field_Service_status is 1 can anyone help me in the dax.

 

ID_METERMASKED_MEPMETER_AGEDEV_CODEEVENT1EVENT2EVENT3EVENT4EVENT5Field_Service_status
11840746.39E+095140 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa0 
11854126.4E+093821 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa0 
204587652173815PR     0 
11854146.4E+095165 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa0 
11845106.4E+093712 Strömavbrott, startStrömavbrott, stoppStrömavbrott, start (Omedelbar leverans)0 
11868936.41E+094780 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa0 
69829086953957PRStrömavbrott, startStrömavbrott, startStrömavbrott, startStrömavbrott, stoppStrömavbrott, stopp0 
11835086.39E+095257 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa1 
11875296.41E+095217 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa1 
11855216.4E+093018 Information, oformateratInformation, oformateratFel, oformateratFel, oformateratFel, oformaterat0 
11880616.41E+095223 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa1 
11864576.4E+095210 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa1 
11848106.4E+095112 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa1 
11858136.4E+095300 Ã–verspänningÖverspänning, stoppÖverspänningÖverspänning, stoppÖverspänning1 
11839096.39E+095264 Klockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa1 
11878716.41E+095196NSKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställaKlockan gick ej att ställa1 

Thanks 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Tarunika ,

You could use the below dax to create a new table  to get filtered table:

Table2 = CALCULATETABLE('Table','Table'[Field_Service_status]=1)

vluwangmsft_0-1669620879164.png

 

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Tarunika ,

You could use the below dax to create a new table  to get filtered table:

Table2 = CALCULATETABLE('Table','Table'[Field_Service_status]=1)

vluwangmsft_0-1669620879164.png

 

 

Best Regards

Lucien

lbendlin
Super User
Super User

You don't need DAX for that.  Add a visual level, page level, or report level filter to your filter pane based on that columns. Or filter already in Power Query.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("1ZVdSsNAEMevsuRJMcjOfu8BFERQsY+lD1uNpTZNSrr0WegRvIJn8AD2Jp7EzSaNTWilFcHuw7KbHSaZ33z80+9HAIphyaI4EudUX5xh7Y4cGHYbcus6zR8mJkOj8cMEJc/IWIvmdrX8eEtTcwR2HA1iT8EZEE/BagiqCAQFQTDj7kFJwQlITwDlxd19jdFdm+ysxc5B8KDYyzbkgNsFlL6iJUTPFs7jfWoWwyK3NnZvMIXdbshns50e6OR2mjwm6dAUKE0WSWGy+akPovrOOhahNK1igToYJlVYIyG0cmeisRK67AWquVw30yHpPNywswCVoSk45Vh1dIf4GENIMqwpJCe63Sr19AZFwbkXy43hw6BqiKvsKS+mxo7zLEZ5dXaTY382XSbp766a/lBYQDezhIaWWcF8T29oM4FQlKSBYKqjzRwabf7vIPfvcQW0DUHxuhKr5efLq/sfzGelY5aNs9H2228d+zOXJkCqse4KomChpVkq2R1b0MJtN70jCHMPjMEX", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID_METER = _t, MASKED_MEP = _t, METER_AGE = _t, DEV_CODE = _t, EVENT1 = _t, EVENT2 = _t, EVENT3 = _t, EVENT4 = _t, EVENT5 = _t, Field_Service_status = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"ID_METER", "MASKED_MEP", "METER_AGE", "DEV_CODE", "Field_Service_status"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Field_Service_status] = "1"))
in
    #"Filtered Rows"

What you will want to do is unpivot all the Event columns.

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.