Forum Discussion

Sogeking's avatar
Sogeking
New Member
8 years ago

Dynamic column name in measure

Hello,

 

I have the following table with accounts and value for each month of the fiscal year. Data is in French, but the problems is the same : I want to create monthly measures, where I need to ping each column in turn.

 

 

For example, I want the measure A as the sum of accounts 101300 and 104100. I would then have to create a measure per column, which is not ideal. My aim is to have a dynamic column name and a single measure that goes something like :

 

CALCULATE(SUM([Month]);Accounts="101300").

 

Do you have any clues ?

 

Thanks

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Sogeking,

     

    AFAIK,power bi not support dynamic column name to use in dax formula.

     

    I'd like to suggest you to use below formula, it can get current all selected rows from current table, so you can create different slicers to make result dynamic.

    result =
    CALCULATE ( SUM ( [Month] ); ALLSELECTED ( Table ) )
    

     

    Regards,

    Xiaoxin Sheng