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! Request now
Hi,
I need to subtract two columns in a table. If the user chooses any month from filter then calculated field should show me the difference. Attached picture for reference.
Solved! Go to Solution.
Hi @gopi1 ,
I created a sample you can have a try.
Table 2 = CALENDARAUTO()
Month = MONTH('Table 2'[Date])
Measure =
var a = SELECTEDVALUE('Table 2'[Month])
var b = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Column] = a && 'Table'[Month] = MAX('Table'[Month])))
var c = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Column] = a && 'Table'[Month] = MAX('Table'[Month])-1))
return
IF(ISFILTERED('Table 2'[Month]), b-c, SUM('Table'[Value]))
Here is my sample that you can download.
Hi @gopi1 ,
I created a sample you can have a try.
Table 2 = CALENDARAUTO()
Month = MONTH('Table 2'[Date])
Measure =
var a = SELECTEDVALUE('Table 2'[Month])
var b = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Column] = a && 'Table'[Month] = MAX('Table'[Month])))
var c = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Column] = a && 'Table'[Month] = MAX('Table'[Month])-1))
return
IF(ISFILTERED('Table 2'[Month]), b-c, SUM('Table'[Value]))
Here is my sample that you can download.
In below function they are pre-defining the values but in my case the month will be in filter. User can choose any months from the filter.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!