Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Multiplication with a variable

Hello everyone,   I have troubles building a measure in Power BI.    I calculated monthly expenditures on Power BI (I divided the whole amount per 12).  I want to have the year-to-date expenditu...
  • amitchandak's avatar
    6 years ago

    Anonymous 

    Try like

    Ytd Expenditures =
    VAR SelectedMonth = countX('Date 2', Values('Date 2'[Month Number]))
    Return
    CALCULATE([Monthly expenditures Cosmetics]*SelectedMonth)
    
    
    
    Ytd Expenditures =
    VAR SelectedMonth = MaxX('Date 2'('Date 2'[Month Number]))
    Return
    CALCULATE([Monthly expenditures Cosmetics]*SelectedMonth)