Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello gents,
I'm new to Power BI and have an issue regarding retreive/calculate period value (month).
The datatable looks like this:
The column day_balance is ending balance value for each period. I have tried with a Measure calculation but it doesn't summerize column total.
Actual Days Period = VAR __PREV_MONTH = CALCULATE([Actual Days]; DATEADD('Calendar'[Date]; -1; MONTH)) RETURN IF ( ISBLANK([Actual Days]); BLANK(); [Actual Days] - __PREV_MONTH)
How can I make a correct calculation period value based monthly "day_balance" value. Appreciate your assistance.
Solved! Go to Solution.
Hi @gselvag,
Please try this measure:
Actual Days Period =
VAR __PREV_MONTH =
CALCULATE (
[Actual Days],
FILTER (
ALLEXCEPT ( Table1, Table1[emp_no] ),
Table1[period].[Year] = YEAR ( MAX ( Table1[period] ) )
&& Table1[period].[MonthNo]
= MONTH ( MAX ( Table1[period] ) ) - 1
)
)
RETURN
IF ( ISBLANK ( [Actual Days] ), BLANK (), [Actual Days] - __PREV_MONTH )
Best regards,
Yuliana Gu
Hi @gselvag,
Please try this measure:
Actual Days Period =
VAR __PREV_MONTH =
CALCULATE (
[Actual Days],
FILTER (
ALLEXCEPT ( Table1, Table1[emp_no] ),
Table1[period].[Year] = YEAR ( MAX ( Table1[period] ) )
&& Table1[period].[MonthNo]
= MONTH ( MAX ( Table1[period] ) ) - 1
)
)
RETURN
IF ( ISBLANK ( [Actual Days] ), BLANK (), [Actual Days] - __PREV_MONTH )
Best regards,
Yuliana Gu
Your measure work like a charm!
Thank You Yuliana
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
74 | |
61 | |
39 | |
36 |