Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello community!
I have a custom column with dates and would like to make a copy of this same column but tweaking it a little. I want this new column to give me blank spaces when the conditions in two other columns are not met.
I want to create a new column with the "end date" when "finalizado" is "Si" (yes) and when "first end date" has a date if not I want a blank space.
If its easier, I could also resolve my problem if some DAX function allowed me to use DISTINCTCOUNT filtering the above conditions.
I tried to solve it myself but since "end date" is a custom column I can't do anything in Power Query (where i suppose it would be easy to solve). Since my knowledge of Power Bi is very limited i'm always trying the same few formulas I know without any success...
Below I have posted some of the data (from a bigger excel) with a column named "expected result" as an example.
As you can see the filters are:
finalizado first end date expected result
SI has a date end date
SI blank blank
NO has a date blank
NO blank blank
I would apreciate if somebody could lend me a hand.
Thanks a lot!
Nº Vehículo | Finalizado | Nº Orden trabajo | first end date | end date | Expected result |
R8871TTD | No | OT18-07989 | 12/12/2018 | ||
R8871TTD | No | OT18-07989 | |||
R0391TTD | Sí | OT18-07530 | 16/11/2018 | 16/11/2018 | 16/11/2018 |
R0391TTD | Sí | OT18-07531 | 15/11/2018 | 16/11/2018 | 16/11/2018 |
R0391TTD | Sí | OT18-07589 | 16/11/2018 | 16/11/2018 | 16/11/2018 |
R6527TTX | Sí | OT18-06471 | 08/11/2018 | 08/11/2018 | 08/11/2018 |
R6527TTX | No | OT18-07973 | 08/11/2018 | 08/11/2018 | |
R6527TTX | Sí | OT18-07111 | 08/11/2018 | 08/11/2018 | 08/11/2018 |
R6527TTX | Sí | OT18-07111 | 06/11/2018 | 08/11/2018 | 08/11/2018 |
8718ZGN | No | OT18-07975 | 05/11/2018 | 05/11/2018 | |
1803UXG | Sí | OT18-08027 | 08/11/2018 | ||
R1415BBR | No | 15/11/2018 | 05/11/2018 | ||
R1415BBR | Sí | OT18-02478 | 06/11/2018 | 06/11/2018 | 06/11/2018 |
3415FBV | Sí | 07/11/2018 | 07/11/2018 | 07/11/2018 | |
8718ZGN | Sí | OT18-02259 | 05/11/2018 | ||
7341JBM | No | OT18-07922 | 21/11/2018 | 07/11/2018 | |
1803UXG | Sí | OT18-08027 | 08/11/2018 | 08/11/2018 | 08/11/2018 |
1803UXG | Sí | OT18-08027 | 08/11/2018 | 08/11/2018 | 08/11/2018 |
Solved! Go to Solution.
Hi @Sorakell,
Looking at your data I think it's easier to do it by if has a No or end date is blank return blank.
See below the code for DAX and also for M language (query editor).
Query Editor (M Language) if ([Finalizado] = "No" or [first end date] = null) then null else [end date]
================ DAX Expected end date DAX = IF ( Table1[Finalizado] = "NO" || Table1[first end date] = BLANK (); BLANK (); Table1[end date] )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Sorakell,
Looking at your data I think it's easier to do it by if has a No or end date is blank return blank.
See below the code for DAX and also for M language (query editor).
Query Editor (M Language) if ([Finalizado] = "No" or [first end date] = null) then null else [end date]
================ DAX Expected end date DAX = IF ( Table1[Finalizado] = "NO" || Table1[first end date] = BLANK (); BLANK (); Table1[end date] )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsWow Felix! that formula you gave me worked perfectly! its amazing!.
Now I only have one more step to achieve the final result. I need to concatenate "expected end date" with "nº vehiculo" applying the same filters as before.
I want the concatenate result: "nº vehicleexpected end date" only when finished is "yes" and "end date" is not blank.
I'm tryingto do it with calculate but I'm not able to do it.
Could you give me a hand?
Thanks a lot! you saved me a lot of time...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |