Reply
Topic Options
- 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
DAX DATESINPERIOD moving to different measure issue
03-14-2024
02:58 AM
Hi guys!
I have below DAX measure and it works correctly.
Date Range Text =
VAR MaxDate = MAX(X_Calendar[DATE])
VAR SelectedPeriod = 'X_Relative Period'[Selected Months Back Number]
VAR Range = DATESINPERIOD('X_Relative Calendar'[DATE], MaxDate, -SelectedPeriod, MONTH)
VAR StartDate = MINX(Range, 'X_Relative Calendar'[DATE])
VAR EndDate = MAXX(Range, 'X_Relative Calendar'[DATE])
RETURN
FORMAT(StartDate, "yyyy-MM") & " to " & FORMAT(EndDate, "yyyy-MM")
I wanted to move the 3 VARS (so the VAR Range output) to different measure so it can be used by few other measures. When I split this measure into two measures:
I wanted to move the 3 VARS (so the VAR Range output) to different measure so it can be used by few other measures. When I split this measure into two measures:
Selected Period Range =
VAR MaxDate = MAX(X_Calendar[DATE])
VAR SelectedPeriod = 'X_Relative Period'[Selected Months Back Number]
VAR Range = DATESINPERIOD('X_Relative Calendar'[DATE], MaxDate, -SelectedPeriod, MONTH)
RETURN Range
AND
I get an error "The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column". Can you advise my why this happens and how to fix it? To my understanding I just split the measure into two. I tried troubleshooting this by creating a calculated column out of the 'Selected Period Range' and apparently a new column with date hierarchy appears there. Can you help me?
AND
X_SW Amount Rounded No Zero Relative =
VAR Range = 'X_Relative Period'[Selected Period Range]
RETURN
CALCULATE(
X_Measures[X_SW Amount Rounded No Zero],
REMOVEFILTERS(X_Calendar),
KEEPFILTERS(Range),
USERELATIONSHIP(X_Calendar[DATE], 'X_Relative Calendar'[DATE]))
I get an error "The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column". Can you advise my why this happens and how to fix it? To my understanding I just split the measure into two. I tried troubleshooting this by creating a calculated column out of the 'Selected Period Range' and apparently a new column with date hierarchy appears there. Can you help me?
Solved! Go to Solution.
1 ACCEPTED SOLUTION
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024
04:57 AM
Hi @lemaribdb
It seems that in part X_SW Amount Rounded No Zero Relative =
VAR Range = 'X_Relative Period'[Selected Period Range]
is issue
try to change this, maybe min or max, like VAR Range =MAX( 'X_Relative Period'[Selected Period Range])
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024
04:57 AM
Hi @lemaribdb
It seems that in part X_SW Amount Rounded No Zero Relative =
VAR Range = 'X_Relative Period'[Selected Period Range]
is issue
try to change this, maybe min or max, like VAR Range =MAX( 'X_Relative Period'[Selected Period Range])
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!

Helpful resources
Recommendations
Subject | Author | Posted | |
---|---|---|---|
07-07-2024 10:35 AM | |||
11-20-2023 12:48 PM | |||
03-15-2024 02:42 AM | |||
06-19-2024 08:36 AM | |||
10-06-2023 04:04 AM |
Top Solution Authors (Last Month)
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |