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

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.

Reply
djr001
Frequent Visitor

Transform date to name of month but keep the column all the same month with different month dates

In this example, all of the transactions on this sheet belong to the accounting month for March. But one of the expenses which is April 1 was included in this report for whatever reason. However, it is part of that reporting period and there is no way to remove it. In this instance, I don’t want the name of the month to roll over to April and want the entire column to remain March. But I have 20 sheets that will have the same issue. And I don’t think replace values is going to be practical for each sheet one by one. How do I force the whole column to stay the same reporting month regardless of the invoice date?

 

Is this going to be complicated?

 

image001_b54633a7b995fc550aa4fa88e0b5ed57.png

 

 

1 ACCEPTED SOLUTION
drewlewis15
Solution Specialist
Solution Specialist

There might be an easier way to do this, but below is an option for you as long as you are trying to capture the month name of the earliest date in your table.

  1. Duplicate your Query
  2. Paste this into the Advanced Editor after your Source step:
    1. #"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Invoice Date"}),
      #"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", let earliest = List.Min(#"Removed Other Columns"[Invoice Date]) in each [Invoice Date] = earliest),
      #"Min Date" = #"Filtered Rows" {0} [Invoice Date]
      in
      #"Min Date"
  3. Change that query name to Min_Date
  4. In your original query, add a custom column with this following statement:
    1. =Date.MonthName(Min_Date)

 

And your end result will look something like this:

2018-01-29_14-14-50.jpg

View solution in original post

1 REPLY 1
drewlewis15
Solution Specialist
Solution Specialist

There might be an easier way to do this, but below is an option for you as long as you are trying to capture the month name of the earliest date in your table.

  1. Duplicate your Query
  2. Paste this into the Advanced Editor after your Source step:
    1. #"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Invoice Date"}),
      #"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", let earliest = List.Min(#"Removed Other Columns"[Invoice Date]) in each [Invoice Date] = earliest),
      #"Min Date" = #"Filtered Rows" {0} [Invoice Date]
      in
      #"Min Date"
  3. Change that query name to Min_Date
  4. In your original query, add a custom column with this following statement:
    1. =Date.MonthName(Min_Date)

 

And your end result will look something like this:

2018-01-29_14-14-50.jpg

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.