Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi all,
Using up-to-date PBID.
This error confuses me since it refers to Year column which shows as whole number in power query.
What am I missing here?
Error:
Error fetching data for this visual
MdxScript(Model) (83,13) Calculation error in meausre 'Sales'(Selected Time Periods New]: Cannot convert value 'Year(s):' of type Text to type True/False.
PBIX is here
DAX:
Selected Time Periods New =
VAR _Div = 12
VAR _Rows_Months = COUNTROWS(VALUES(Calendar[Month]))
Var _Mod = MOD(_Rows_Months,_Div)
VAR _Rows_Quarters = COUNTROWS(VALUES(Calendar[Quarter]))
VAR _Rows_Years = COUNTROWS(VALUES('Calendar'[Year]))
VAR _Result =
IF(
_Mod = 0,
"Year{s}: " &&
CONCATENATEX(
VALUES('Calendar'[Year]),
FORMAT('Calendar'[Year],"0000"),
", "
) && UNICHAR(10) &&
"Quarter(s): " &&
CONCATENATEX(
VALUES(Calendar[Quarter]),
Calendar[Quarter],
", "
),
"Year{s}: " &&
CONCATENATEX(
VALUES('Calendar'[Year]),
FORMAT('Calendar'[Year],"0000"),
", "
) && UNICHAR(10) &&
"Quarter(s): " &&
CONCATENATEX(
VALUES(Calendar[Quarter]),
Calendar[Quarter],
", "
) && UNICHAR(10) &&
"Month(s): " &&
CONCATENATEX(
VALUES(Calendar[Month]),
Calendar[Month],
", "
)
)
RETURN
_Result
Solved! Go to Solution.
&& is the logical comparison AND, you should be using just a single & to join strings.
Phil
Proud to be a Super User!
&& is the logical comparison AND, you should be using just a single & to join strings.
Phil
Proud to be a Super User!
Du-oh! (Homer)
Thanks Phil!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |