Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello, I have created dynamic Comparison Between Periods using Parameter and DAX measures. It works, however, sometimes shows this error
My DAX measure looks like this:
Solved! Go to Solution.
Hi @markzuev96 ,
Looking at your DAX, the "can't determine a single value" error usually happens when your parameter table or date selections are returning multiple values instead of single ones.
Most likely culprits:
Parameter selection issue: Your SELECTEDVALUE(ComparisonType[Comparison]) is probably returning BLANK() sometimes, which means either no comparison type is selected or multiple ones are selected. Add some debugging:
VAR ComparisonType = IF( ISBLANK(SELECTEDVALUE(ComparisonType[Comparison])), "Previous Period", -- default value SELECTEDVALUE(ComparisonType[Comparison]) )
Date filter context problems: When there's no clear date selection, MIN(DateTable[Date]) and MAX(DateTable[Date]) might be acting weird. Try this:
VAR SelectedStart = IF( ISFILTERED(DateTable[Date]), MIN(DateTable[Date]), BLANK() ) VAR SelectedEnd = IF( ISFILTERED(DateTable[Date]), MAX(DateTable[Date]), BLANK() )
Add an early exit:
-- Right after your date variables RETURN IF( ISBLANK(SelectedStart) || ISBLANK(SelectedEnd) || ISBLANK(ComparisonType), BLANK(), -- rest of your calculation here )
Quick test: Put your measure in a card visual with no filters applied. If it shows the error, then it's definitely a parameter/context issue.
The error usually shows up when users haven't made proper selections yet, or when the report first loads. Adding those validation checks should fix it.
Try the parameter default value fix first - that's usually the main culprit.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.
Hi @markzuev96 ,
Looking at your DAX, the "can't determine a single value" error usually happens when your parameter table or date selections are returning multiple values instead of single ones.
Most likely culprits:
Parameter selection issue: Your SELECTEDVALUE(ComparisonType[Comparison]) is probably returning BLANK() sometimes, which means either no comparison type is selected or multiple ones are selected. Add some debugging:
VAR ComparisonType = IF( ISBLANK(SELECTEDVALUE(ComparisonType[Comparison])), "Previous Period", -- default value SELECTEDVALUE(ComparisonType[Comparison]) )
Date filter context problems: When there's no clear date selection, MIN(DateTable[Date]) and MAX(DateTable[Date]) might be acting weird. Try this:
VAR SelectedStart = IF( ISFILTERED(DateTable[Date]), MIN(DateTable[Date]), BLANK() ) VAR SelectedEnd = IF( ISFILTERED(DateTable[Date]), MAX(DateTable[Date]), BLANK() )
Add an early exit:
-- Right after your date variables RETURN IF( ISBLANK(SelectedStart) || ISBLANK(SelectedEnd) || ISBLANK(ComparisonType), BLANK(), -- rest of your calculation here )
Quick test: Put your measure in a card visual with no filters applied. If it shows the error, then it's definitely a parameter/context issue.
The error usually shows up when users haven't made proper selections yet, or when the report first loads. Adding those validation checks should fix it.
Try the parameter default value fix first - that's usually the main culprit.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.
thank you
Hi @markzuev96 ,
Thanks for reaching out to the Microsoft fabric community forum.
Could you please provide sample data that fully represents the issue or question you're referring to? Kindly ensure the data is in a usable format (e.g., Excel or CSV) rather than a screenshot, and does not contain any sensitive or unrelated information.
Looking forward to your response.
Best regards,
Lakshmi