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

Is it possible to use Short Month Name in TOTALYTD?

Hello everyone,

 

I've created a measure to calculate the total value of open cases year to date (until today), as shown below:

All Count Cases YTD = 

TOTALYTD(
    COUNT('Case'[CaseNumber]);
    'Case'[CreatedDate].[Date];
    FILTER(
        ALL('Case');
        'Case'[CreatedDate] <= MAX('Case'[Today])
    )
)

 

Everything worked fine:

image.pngTable dataTable data

 

The Column CreatedDate is formated as Date and has hierarchy:

CreatedDate as hierarchyCreatedDate as hierarchy

 

My problem starts when I try to show only first 3 letter of the month in table.

To do it, I created a new column in query, using following M formula, based on column CreatedDate:

#"Nome do Mês Inserido" = Table.AddColumn(#"Colunas Reordenadas", "MonthName(mmm)", each Text.Start(Date.MonthName([CreatedDate], "en-US"), 3), type text),

 

My column is formated as text (maybe here is the problem, dunno).

image.png

 

When I try to use this column in the table the measure get lost:

image.png

 

All columns are in the same table, because of that I thought they'd be related each other, but don't.

 

Is it possible to do what I want? If so, what's the right way to do it?

 

Thank you.

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

@LPenatti ,

 

The month-only date is not in date format, you need to convert to date format from text like below:

#"Nome do Mês Inserido" = Table.AddColumn(#"Colunas Reordenadas", "MonthName(mmm)", each Date.FromText(Text.Start(Date.MonthName([CreatedDate], "en-US"), 3)), type date),

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@LPenatti ,

 

The month-only date is not in date format, you need to convert to date format from text like below:

#"Nome do Mês Inserido" = Table.AddColumn(#"Colunas Reordenadas", "MonthName(mmm)", each Date.FromText(Text.Start(Date.MonthName([CreatedDate], "en-US"), 3)), type date),

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.