Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Transform data from a summarized format into a more granular format

I would like to know if Power BI has such function that for example. I have a regular allowance payment to employee and the data report is only show one row with the payment period and i would to like convert to monthly payment items based on the start date and end date? can Power BI make it happen?

 

  • You could create a new table like

    Detailed Table = SELECTCOLUMNS(
    	GENERATE(
    		'Table',
    		VAR _Dates = FILTER( CALENDAR( 'Table'[Start Date], 'Table'[End Date] ), DAY( [Date] ) = 1 )
    		VAR Result = SELECTCOLUMNS(
    			_Dates,
    			"Start Month", [Date],
    			"End Month", EOMONTH( [Date] , 0 )
    		)
    		RETURN Result
    	),
    	[Name],
    	[Allowance],
    	[Start Month],
    	[End Month]
    )

3 Replies

  • You could create a new table like

    Detailed Table = SELECTCOLUMNS(
    	GENERATE(
    		'Table',
    		VAR _Dates = FILTER( CALENDAR( 'Table'[Start Date], 'Table'[End Date] ), DAY( [Date] ) = 1 )
    		VAR Result = SELECTCOLUMNS(
    			_Dates,
    			"Start Month", [Date],
    			"End Month", EOMONTH( [Date] , 0 )
    		)
    		RETURN Result
    	),
    	[Name],
    	[Allowance],
    	[Start Month],
    	[End Month]
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you soooooo much for the solution which solve my problem and give me more insights for the new function with VAR😊