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,
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.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |