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.
for example, I want to use parametes of a certain column, and I want to remove the filters between fact[month] and dim[month]
and there is relationship between two table with month.
I want to know when a selected month and return all the first month of selected quarter to selected month with 1, and slicer is from dim[month],
from example, if dim[month]= 202302, then return a table like this:
month cal
202301 1
202302 1
202303 0
202304 0
....
202312 0
and month columns is from fact[month]
all the value were text type.
I created a dax like this but not work because I don't know where to add the removefilters function:
cal=
VAR _a=MAX(fact[month])
RETURN
IF(_a>= SELECTEDVALUE(dim[quarter])*3-2 && _a<=SELECTEDVALUE(dim[month])
,1,0)
do you have any solution? Thank you.
Solved! Go to Solution.
Actually I've solved it still use removefilters, and DAX seems like this:
IF(
CALCULATE(
MAX(fact[month]), REMOVEFILTERS(dim[date])
<=SELECTEDVALUE(dim[month])
,1,0)
Actually I've solved it still use removefilters, and DAX seems like this:
IF(
CALCULATE(
MAX(fact[month]), REMOVEFILTERS(dim[date])
<=SELECTEDVALUE(dim[month])
,1,0)
Hi @oakgogo ,
Using REMOVEFILTERS, as the name suggests, essentially clears the filter on the table or column it is being applied on so CALCULATE ( MAX( 'table'[column] ), REMOVEFILTERS ('table') ) will always return the max value of [column] regardless of the filters applied to 'table'. Use CROSSFILTER instead to change the behavior of a relationship.
Proud to be a Super User!
could you provide an example to solve the situation?
In the attached sample, there is a relationship between Dates and Fact table and I disabled that in a measure using CROSSFILTER.
test =
CALCULATE (
SELECTEDVALUE ( 'Table'[effectivedate] ) <= [maxdate],
CROSSFILTER ( 'Table'[effectivedate], Dates[Date], NONE )
)
Proud to be a Super User!
Thank you, does this crossfilter have to use along with calculate? how about without using calculate?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
142 | |
72 | |
62 | |
51 | |
48 |
User | Count |
---|---|
206 | |
90 | |
61 | |
59 | |
57 |