Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 expenditures, calculated automatically when you choose the month.
The formula looks like that :
Year-to-date expenditures = [Monthly expenditures] * [Number of the month]
For example, in March, you multiple by 3.
I tried with VAR but it doesn't work.
This is what I wrote.
Thank you for your help.
Solved! Go to Solution.
@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)
@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)
The second one is working !!
Thank you very much 😍
User | Count |
---|---|
102 | |
90 | |
80 | |
71 | |
69 |
User | Count |
---|---|
114 | |
100 | |
97 | |
72 | |
68 |