Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi All,
i need help to find a right formula.
I do have 3 colum: Date ( dates ) - Origin ( Text ) - Destination ( Text ). The goal here is to find old and new lanes.
i am trying to look at ( Origin and Destination column together ) and if these value ( together ) are in column Date ( 2018 ) then is an old lane other wise ( if in 2019 ) is a new lane....
i hope this above is clear.
thanks
Diego
Solved! Go to Solution.
Hi @Anonymous ,
We can create a measure as below.
Measure =
VAR countr =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( 'Table', YEAR ( 'Table'[date] ) = 2018 )
)
RETURN
IF ( ISBLANK ( countr ), "new lane", "old lane" )
Or we can crreate a calculated column to work on it.
Column =
VAR countr =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[origin], 'Table'[destination] ),
YEAR ( 'Table'[date] ) = 2018
)
)
RETURN
IF ( countr = BLANK (), "new lane", "old lane" )
Hi @Anonymous ,
We can create a measure as below.
Measure =
VAR countr =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( 'Table', YEAR ( 'Table'[date] ) = 2018 )
)
RETURN
IF ( ISBLANK ( countr ), "new lane", "old lane" )
Or we can crreate a calculated column to work on it.
Column =
VAR countr =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[origin], 'Table'[destination] ),
YEAR ( 'Table'[date] ) = 2018
)
)
RETURN
IF ( countr = BLANK (), "new lane", "old lane" )
Can you provide a sample of your data and the expected result? Hard to write a formula to help when you are trying to compare two text columns to a date column with no context for what the text actually is.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingIf you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 6 | |
| 6 | |
| 5 |