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
DYY94
Helper I
Helper I

Convert Measure into a column

Hello Community, 

 

  •  I want to duplicate rows by Code_ISIN for each dates.
  •  Each date in a row with the same Code_ISIN. 

NB: Dates it's a measure ! 

 

So I thought to convert the Measure 'dates' into column first ! 

 

Any Ideas ? 

 

This is my measure : 

dates = 
VAR str = SELECTCOLUMNS(BTA_Output,"d",BTA_Output[Maturite])&"-"&[MR/365]
VAR _date =
    FORMAT (SELECTCOLUMNS(BTA_Output,"d",BTA_Output[Maturite]), "yyyy/mm/dd" )
VAR _num =
    [MR/365] 
VAR _cal =
    "-"
VAR tmp =
    FILTER (
        ALL ( 'Date' ),
        YEAR ( [Date] )
            > YEAR ( _date ) - _num
            && YEAR ( [Date] ) < YEAR ( _date )
            && MONTH ( [Date] ) = MONTH ( _date )
            && DAY ( [Date] ) = DAY ( _date ) 
    )
VAR _a =
    CONCATENATEX ( tmp, [Date], "
" )
RETURN
    SWITCH ( TRUE (), _cal = "-", _a )

Output: 

 Capture2.PNG

Thanks ! 

2 REPLIES 2
daXtreme
Solution Sage
Solution Sage

I don't know what it is you want... but this code

 

    FILTER (
        ALL ( 'Date' ),
        YEAR ( [Date] )
            > YEAR ( _date ) - _num
            && YEAR ( [Date] ) < YEAR ( _date )
            && MONTH ( [Date] ) = MONTH ( _date )
            && DAY ( [Date] ) = DAY ( _date ) 
    )

 

will most likely break on leap years... since February has variable number of days, not always the same.

 

By the way, measures are dynamic and react to selections. Columns are always static, so I don't quite get how you want to make a measure into a column...

Hi @daXtreme

Thank you for answer. 

 

- don't worry about the measure it works fine for me. But my probleme is i want to duplicate rows by Code_ISIN for each dates knowing that dates it's a measure. 

- I want each date in a row with the same Code_ISIN ! 

 

Thanks.

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.