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
I have a column with values of Non-Covid and Covid. If the value is Covid, the fiscal year needs to be formatted and populated based on the Scheduled Start column. If the value is Non-Covid, the fiscal year needs to be formatted and populated based on the Reported Date column. My formula is
Solved! Go to Solution.
If this is a calculated column in a table, try:
Fiscal Month/Yr = IF(
'2700 WO Listing'[Covid vs Non-Covid (groups)]="Non-Covid",
FORMAT('2700 WO Listing'[Reported Date],"MMM-yyyy"),
FORMAT('2700 WO Listing'[Scheduled Start],"MMM-yyyy")
)
If you are using this in a measure, try:
Fiscal Month/Yr = IF(
MAX( '2700 WO Listing'[Covid vs Non-Covid (groups)]) = "Non-Covid",
FORMAT('2700 WO Listing'[Reported Date],"MMM-yyyy"),
FORMAT('2700 WO Listing'[Scheduled Start],"MMM-yyyy")
)
Proud to be a Super User!
Paul on Linkedin.
@ahhollan this syntax should work for calculated column:
but it would not work for a measure.
also, the way you have it written will make it a text column. You could also remove the format() from each part and just return each them as dates, then format the column into the desired format if you want it to still behave as a date column.
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
you lost some parentheses, formulas and quotation marks. Try this:
Fiscal Month/Yr =
IF (
'2700 WO Listing'[Covid vs Non-Covid (groups)] = "Non-Covid",
FORMAT ( '2700 WO Listing'[Reported Date], "MMM-yyyy" ),
FORMAT ( '2700 WO Listing'[Scheduled Start], "MMM-yyyy" )
)
|
Proud to be a Super User. If I helped, please accept the solution and give kudos! |
If this is a calculated column in a table, try:
Fiscal Month/Yr = IF(
'2700 WO Listing'[Covid vs Non-Covid (groups)]="Non-Covid",
FORMAT('2700 WO Listing'[Reported Date],"MMM-yyyy"),
FORMAT('2700 WO Listing'[Scheduled Start],"MMM-yyyy")
)
If you are using this in a measure, try:
Fiscal Month/Yr = IF(
MAX( '2700 WO Listing'[Covid vs Non-Covid (groups)]) = "Non-Covid",
FORMAT('2700 WO Listing'[Reported Date],"MMM-yyyy"),
FORMAT('2700 WO Listing'[Scheduled Start],"MMM-yyyy")
)
Proud to be a Super User!
Paul on Linkedin.
If 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 |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 70 | |
| 39 | |
| 35 | |
| 23 |