Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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 😍
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
83 | |
64 | |
61 | |
55 |
User | Count |
---|---|
171 | |
109 | |
105 | |
73 | |
71 |