- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Measure context issue
Hello Everyone,
I am coming to you guys because I have an issue regarding a measure that I was not able to solve yet:
What I would like is to filter Date TO Compare (FIELD of TABLE1) with the Non Context Date (Measure with ALLSELECTED(TABLE1)).
I am doing the following command:
Max TEST 3 = CALCULATE(DISTINCTCOUNT(TABLE1.FIELD1), FILTER(TABLE1, TABLE1.DateToCompare <= TABLE1.NonContextDate))
However, it seems the Context Date is used instead of Non Context Date.
Here the result:
Thank you, in advance, for your help.
Regards,
Thomas
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Anonymous ,
NonContextDate = CALCULATE(MAX('TABLE1'[Context Date]),ALLSELECTED(TABLE1))
ALLSELECTED will cause some problem if you use it directly. You can try ALL function or you can try this code.
Max TEST 3 =
VAR _ADD =
ADDCOLUMNS ( TABLE1, "NonContextDate", [NonContextDate] )
RETURN
COUNTAX ( _ADD, [NonContextDate] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not clear what your actual issue is. What is the expected outcome?
Max TEST 3 = CALCULATE(DISTINCTCOUNT(TABLE1.FIELD1), FILTER(ALL(TABLE1), TABLE1.DateToCompare <= TABLE1.NonContextDate))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @lbendlin,
Thank you for your time.
Expected outcome should be for the last row 1 instead of BLANK.any
NonContextDate = CALCULATE(MAX(ContextDate), ALLSELECTED(TABLE1))
But It seems it ignored the ALLSELECTED within Max TEST 3 measure.
Regards,
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Anonymous ,
NonContextDate = CALCULATE(MAX('TABLE1'[Context Date]),ALLSELECTED(TABLE1))
ALLSELECTED will cause some problem if you use it directly. You can try ALL function or you can try this code.
Max TEST 3 =
VAR _ADD =
ADDCOLUMNS ( TABLE1, "NonContextDate", [NonContextDate] )
RETURN
COUNTAX ( _ADD, [NonContextDate] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Anonymous ,
NonContextDate = CALCULATE(MAX('TABLE1'[Context Date]),ALLSELECTED(TABLE1))
ALLSELECTED will cause some problem if you use it directly. You can try ALL function or you can try this code.
Max TEST 3 =
VAR _ADD =
ADDCOLUMNS ( TABLE1, "NonContextDate", [NonContextDate] )
RETURN
COUNTAX ( _ADD, [NonContextDate] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
08-15-2024 06:08 AM | |||
08-05-2024 04:04 PM | |||
09-17-2024 10:55 AM | |||
05-11-2024 07:00 PM | |||
Anonymous
| 02-06-2024 07:06 AM |