Forum Discussion

JOHN14400's avatar
JOHN14400
Frequent Visitor
6 years ago
Solved

Transform data month to daily data

Hello I would like transform Objective data month to daily objective

STOREPRODUCTDATEOBJECTIF
Bayeux( France)SaladesJanuary 2020124
Bayeux( France)SaladesFebruary 2020248

 

 

STOREPRODUCTDATEOBJECTIF
Bayeux( France)Salades1 January 20204
Bayeux( France)Salades2 January 20204
Bayeux( France)Salades3 January 20204
Bayeux( France)Salades4 January 20204
Bayeux( France)Salades5 January 20204
Bayeux( France)Salades1 february 20208
Bayeux( France)Salades2 february 20208

 

Somebody could help me ? For example, I didn't write every date on january but it continues to 31 and after 1er february , 2 february , etc....

Sorry for my basic English

Thanks

  • JOHN14400's avatar
    JOHN14400
    6 years ago

    Good evening GIOTTO (time France)

     

    Thanks a lot, that's exactly what I would like. with your solution, I changed (language M) by adding data several others shops ( rail station in fact).

     

    it was time , I used the microsoft'blog ; It's magic for  a  advanced beginner like me

     

     

3 Replies

  • v-gizhi-msft's avatar
    v-gizhi-msft
    Icon for Community Support rankCommunity Support

    Hi,

     

    Please take following steps:

    1)Create a target table:

    Target table = CALENDAR(MIN('Table'[Date]),DATE(YEAR(MAX('Table'[Date])),MONTH(MAX('Table'[Date]))+1,1)-1)

    2)Create these columns in target table:

    Days per month = CALCULATE(COUNT('Target table'[Date]),FILTER('Target table','Target table'[Month]=EARLIER('Target table'[Month])))
    Month = MONTH('Target table'[Date])

    3)Try this measure:

    Measure =
    ROUNDDOWN (
        CALCULATE (
            SUM ( 'Table'[Objectif] ),
            FILTER ( 'Table', MONTH ( 'Table'[Date] ) = MAX ( 'Target table'[Month] ) )
        )
            / MAX ( 'Target table'[Days per month] ),
        0
    )

    4)The result shows:

    Here is my test pbix file:

    pbix 

    Hope this helps.

     

    Best Regards,

    Giotto

     

    • JOHN14400's avatar
      JOHN14400
      Frequent Visitor

      Good evening GIOTTO (time France)

       

      Thanks a lot, that's exactly what I would like. with your solution, I changed (language M) by adding data several others shops ( rail station in fact).

       

      it was time , I used the microsoft'blog ; It's magic for  a  advanced beginner like me