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
Hello ! 😁
I'm trying to filter values from a Column chart :
The chart looks like this :
And I use a Slicer to filter values like this :
The values are from a table Parametres
So here is my Selection_Date measure :
Selection Date = [DateFilter]
DateFilter is an other measure that choose how to filter the values (based on the slicer's selection).
DateFilter =
var _today = TODAY()
var _month = MONTH(_today)
var _year = YEAR(_today)
var _last_30_days = _today - 30
return SWITCH(SELECTEDVALUE(Parametres[Selection_date]),
"Last30Days", CALCULATE( SUM(v_revenues[qty]), FILTER(v_dates, v_dates[Date] > _last_30_days )),
"MonthToDate", CALCULATE(SUM(v_revenues[qty]), FILTER(v_dates, v_dates[actual_month] = 1)),
"YearToDate", CALCULATE(SUM(v_revenues[qty]), FILTER(v_dates, v_dates[actual_year] = 1))
)
This measure works but I still have one problem. The filter is ok but when I filter a values (example month to date) all the value that are not in the selection (all the values that are not november 2021) are still visible but they are empty :
So here is my question :
How can I add the values that are not in the selection ? How can I filter so it only display the values that are in the checked in the slicer ?
Per example, for Date to Month I want only this to be displayed
Thank you for your help
Solved! Go to Solution.
Hi, @Anonymous ;
You could create a flag measure to calculate whether the value corresponding to each X-axis is 0. If it is 0, you can use Filter in Visual to filter it. I made a simple example:
1.in my data (0-5 months value is 0)
2. set flag measure is not 0 .
The final output is shown below:
If not right, can you share a simple file or data?
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
You could create a flag measure to calculate whether the value corresponding to each X-axis is 0. If it is 0, you can use Filter in Visual to filter it. I made a simple example:
1.in my data (0-5 months value is 0)
2. set flag measure is not 0 .
The final output is shown below:
If not right, can you share a simple file or data?
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You should create an independent table with these values and then should measure , but if select a date, you can get more than date. So in that case we use independent date table for slicer and use the joined date table for datesytd and datesmtd
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
sales =
var _max = maxx(allselected('Date1'),'Date'[Date])
var _min = _max -30
return
calculate([Measure], filter('Date', 'Date'[Date] <=_max && 'Date'[Date] >=_min))
YTD =
var _max = maxx(allselected('Date1'),'Date'[Date])
var _min = date(year(_max),1,1)
var _day = _max
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _day) )
MTD =
var _max = maxx(allselected('Date1'),'Date'[Date])
var _min = eomonth(_max,-1) +1
var _day = _max
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _day) )
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.