Forum Discussion
Interaction between line chart and pie chart
- Anonymous3 years ago
Hi mvega07 ,
You can add filters to the code instead of the visual filters. Try using this MEASURE in the pie chart.
Current Month Sales = CALCULATE ( SUM ( 'FactSalesTable'[Sales] ), 'Calendar'[Year] = YEAR ( TODAY () ) && 'Calendar'[Month Number] = MONTH ( TODAY () ) )If the current month refers to the month and year of the largest date in the date table, you can use this variable instead of TODAY().
VAR _max_date = CALCULATE(MAX('Calendar'[Date]),ALL())For the line chart, you can add a column to the date table.
then add a visual filter.
result:
Best Regards,
Gao
Community Support TeamIf 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 feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
mvega07 , Try new measures like for pie
new measure =
var _max = Minx(allselected(Date,Date[Date])
return
calculate( sum(Table[Value]), filter('Date', eomonth('Date'[Date],0) = eomonth(_max,0)))