Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 10 | |
| 9 |