Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi
I have one scenario
I want to calculate Month coloumn , condition is that higehst month should be 0 and the preceeding back month should be minus by 1.
Please help me to solve this issue.
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
It is for creating a new column.
Month expected result CC =
VAR _currentdate = Data[Date]
VAR _maxdate =
MAX ( Data[Date] )
VAR _mindate =
MIN ( Data[Date] )
VAR _monthlytable =
SUMMARIZE (
ADDCOLUMNS (
CALENDAR ( _mindate, _maxdate ),
"@endofmonth", EOMONTH ( [Date], 0 )
),
[@endofmonth]
)
RETURN
-1
* (
COUNTROWS ( FILTER ( _monthlytable, [@endofmonth] >= _currentdate ) ) - 1
)
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
It is for creating a new column.
Month expected result CC =
VAR _currentdate = Data[Date]
VAR _maxdate =
MAX ( Data[Date] )
VAR _mindate =
MIN ( Data[Date] )
VAR _monthlytable =
SUMMARIZE (
ADDCOLUMNS (
CALENDAR ( _mindate, _maxdate ),
"@endofmonth", EOMONTH ( [Date], 0 )
),
[@endofmonth]
)
RETURN
-1
* (
COUNTROWS ( FILTER ( _monthlytable, [@endofmonth] >= _currentdate ) ) - 1
)
Hi @Anonymous
You acan use
Month =
RANKX ( 'Table', 'Table'[Date],, DESC, Dense ) - 1
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.