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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mmace1
Impactful Individual
Impactful Individual

Column is INT. Corresponding column on Calender table is in Date format - way to showthat column?

I have a measure:

 

calculate(min(FACTTimeSheet[FKProjTransDate]),TimeSheet[ApprovalStatus]="Posted")

 


but the column FKProjTransDate  is an INT, not a Date. So it will return something like 20220912; I'd like to get it formatted as a date. 

The Calendar table connects to FACTTimeSheet, and has a corresponding column for 2022-09-12 as a Date - is there a performant way to bring down the actual Date from the Calendar table, into this measure?  I think I've done this before long ago...

The reason I'm not just making an extra column in Date Format: 

  • This is a live connection - so can't in power BI itself, and anyway I need it in the central model. 
  • Live connection to a UAT AAS Cube, and while I can modify the Views to convert that INT to a Date, 90% chance that gets overwritten every night until we go live (or so I've experienced). So I'd rather solve this within the measure, which I can just save in an Excel file. 






2 REPLIES 2
parry2k
Super User
Super User

@mmace1 or try this measure:

 

calculate(min(DateTable[Date Column]),TimeSheet[ApprovalStatus]="Posted",FKProjTransDate)

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Greg_Deckler
Super User
Super User

@mmace1 Maybe:

Measure =
  VAR __Int = calculate(min(FACTTimeSheet[FKProjTransDate]),TimeSheet[ApprovalStatus]="Posted")
  VAR __Year = LEFT(__Int & "",4) + 0
  VAR __Day = RIGHT(__Int & "",2) + 0
  VAR __Month = MID(__Int & "",5,2) + 0
RETURN
  DATE(__Year, __Month, __Day)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.