Forum Discussion

fbittencourt's avatar
fbittencourt
Icon for Helper IV rankHelper IV
1 year ago
Solved

Add date on my fact table

Simple question, my current Fact table needs a date column, I have already two columns that represents YEAR and MONTH both are text, I need to create a new column "Date" based on both columns, to con...
  • grazitti_sapna's avatar
    1 year ago

    Hi fbittencourt,

     

    Use Below  Function in Power Query to create date column 

     

    #date( Number.FromText([Year]), Number.FromText([Month]), 1 )

     

    or DAX

     

    Date =
    DATE ( VALUE ( FactTable[Year] ), VALUE ( FactTable[Month] ), 1 )

     

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
    🔗 Curious to explore more? [Discover here].
    Let’s keep building smarter solutions together!

  • anmolmalviya05's avatar
    1 year ago

    Hi fbittencourt, Hope you are doing well!

    You can achieve this by using a calculated column with DAX:

    Use below DAX to create the calculated column:
    Date =
    DATE (
    VALUE ( 'Fact'[Year] ),
    VALUE ( 'Fact'[Month] ),
    1
    )

     


    If this post helps to answer your question, please consider accepting it as a solution so others can find it more quickly when they face a similar challenge.




    Proud to be a Microsoft Fabric community super user




    Let's Connect on LinkedIn




    Subscribe to my YouTube channel for Microsoft Fabric and Power BI updates.

     

  • v-menakakota's avatar
    1 year ago

    Hi  fbittencourt  , 

    Thanks for reaching out to the Microsoft fabric community forum. 

    I would also take a moment to thank  anmolmalviya05 , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference. 

    Best Regards, 
    Community Support Team