Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
I am trying to create a column chart that can show all preious years' annual total gross profits and current year year to date total gross profit, when a year and/or a month end date is selected from the filter panel. Is it possible? If not, 2 separate column charts work as well. Please visit the link to download the file. Thank you very much! https://www.dropbox.com/t/GXPnp2SXwDa22DHM
Solved! Go to Solution.
@InfiniteSheldon , if you select a month or a year, and you want to show more than that you need slicer on an independent date table.
example measure
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -60) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Hi @InfiniteSheldon,
You may try these two measures.
current year year to date total gross profit =
CALCULATE (
SUM ( 'Gross Profit'[Gross Profit] ),
FILTER (
ALL ( 'Gross Profit' ),
'Gross Profit'[Month End Date] <= MAX ( 'Date'[Month End Date] )
&& YEAR ( 'Gross Profit'[Month End Date] ) = MAX ( 'Date'[Year] )
)
)
preious years' annual total gross profits =
VAR selectedMonEndDate =
MAX ( 'Date'[Month End Date] )
VAR selectedYear =
SELECTEDVALUE ( 'Date'[Year], YEAR ( selectedMonEndDate ) )
RETURN
CALCULATE (
SUM ( 'Gross Profit'[Gross Profit] ),
FILTER (
ALL ( 'Gross Profit' ),
YEAR ( 'Gross Profit'[Month End Date] ) = ( selectedYear - 1 )
)
)
Then, the result looks like this.
For more details, you could refer to the attached pbix file.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
@InfiniteSheldon , if you select a month or a year, and you want to show more than that you need slicer on an independent date table.
example measure
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -60) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.