Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
14 | |
11 | |
7 |
User | Count |
---|---|
26 | |
24 | |
12 | |
11 | |
10 |