Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I would like to calculate the user balance for a specific month.
Sample data:
When I applied filter [Year] = 2022 and [Month] = December, it should take the balance with GREEN highlight.
Expected outcome:
Does anyone have any ideas what kind of formula I should apply?
Any help would be much appreciated.
Thanks in advance!
Kindly Regards,
Milan
Solved! Go to Solution.
Hi @Milan14
Please refer to attaches sample file with the solution
Balance Measure =
VAR SelectedDate = MAX ( 'Date'[Date] )
VAR Result =
SUMX (
VALUES ( 'Table'[UserID] ),
VAR CurrentIDTable = CALCULATETABLE ( 'Table' )
VAR MaxDateRecord = TOPN ( 1, FILTER ( CurrentIDTable, 'Table'[Date] <= SelectedDate ), 'Table'[Date] )
RETURN
MAXX ( MaxDateRecord, 'Table'[Balance] )
)
RETURN
Result
Hi @Milan14
Please refer to attaches sample file with the solution
Balance Measure =
VAR SelectedDate = MAX ( 'Date'[Date] )
VAR Result =
SUMX (
VALUES ( 'Table'[UserID] ),
VAR CurrentIDTable = CALCULATETABLE ( 'Table' )
VAR MaxDateRecord = TOPN ( 1, FILTER ( CurrentIDTable, 'Table'[Date] <= SelectedDate ), 'Table'[Date] )
RETURN
MAXX ( MaxDateRecord, 'Table'[Balance] )
)
RETURN
Result
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
42 | |
33 | |
30 | |
18 | |
18 |