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
mrthib
New Member

UPPER first occurance in a column

I am creating a table that tracks different software versions that have been pushed to different user groups. Since these do not change everyday I used the fill function in Power Query to fill down from the latest version. The table is fairly large so in order to quickly find when a new version was sent out I would like to capitalize the first occurance of every version. I am trying to do this in DAX but having some weird issues.

 

Here is a sample of the data

DateColumn1
1/1/2018a
1/2/2018a
1/3/2018a
1/4/2018b
1/5/2018c
1/6/2018c
1/7/2018c
1/8/2018c
1/9/2018c
1/10/2018d
1/11/2018d
1/12/2018d
1/13/2018e
1/14/2018f
1/15/2018f
1/16/2018f
1/17/2018f
1/18/2018f
1/19/2018g
1/20/2018g
1/21/2018g

 

 

The calculated column I wrote was

Column2 2 = IF(Sheet1[Column2] = CALCULATE(VALUES(Sheet1[Column2]), 
            DATEADD(Sheet1[Date], -1, DAY))
            , Sheet1[Column2], UPPER(Sheet1[Column2]))

The problem though is that it just returns a table of all caps!

DateColumn2Column2 2
1/1/2018aA
1/2/2018aA
1/3/2018aA
1/4/2018bB
1/5/2018cC
1/6/2018cC
1/7/2018cC
1/8/2018cC
1/9/2018cC
1/10/2018dD
1/11/2018dD
1/12/2018dD
1/13/2018eE
1/14/2018fF
1/15/2018fF

If I replace the 'if true' part of the function with '1' and if false with '0' it returns 1's and 0's in the correct spots. I am not sure if there is some row context I am missing or something.

 

This is what it should return

DateColumn2Column2 2
1/1/2018aA
1/2/2018aa
1/3/2018aa
1/4/2018bB
1/5/2018cC
1/6/2018cc
1/7/2018cc
1/8/2018cc
1/9/2018cc
1/10/2018dD
1/11/2018dd
1/12/2018dd
1/13/2018eE
1/14/2018fF
1/15/2018ff
4 REPLIES 4
ChandeepChhabra
Impactful Individual
Impactful Individual

@mrthib : Ashish is correct, I am having the same error as his

A quick workaround is to concatenate the UPPER with space " "

 

UPPER(Data[Column1]&" ") It somehow works this way

 

cap.PNG

 

 

Thanks @ChandeepChhabra, this work around works pretty well. The only issue with it is that it capitalizes the most recent version no matter if it is the first occurance or not. It is only doing this on my data set though and I could not replicate the issue with the mock data set I put in the question. This whole thing is some very strange behavior.

Hi @mrthib,

 

This issue has been reported internally, CRI: 67060820.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

I can confirm that there is a clear bug there.  I tried this calculated column formula and the result is the same as yours

 

=if(ISBLANK(CALCULATE(COUNTROWS(Table1),FILTER(Table1,Table1[Version]=EARLIER(Table1[Version])&&Table1[Date]<EARLIER(Table1[Date])))),UPPER(Table1[Version]),LOWER(Table1[Version]))

 

Untitled.png

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.