Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
garythomannCoGC
Impactful Individual
Impactful Individual

DAX why the error when the focus has changed

sql programmer having 'fun' with dax :}    Current post while trying to get a query to work, dax syntax

Now different question, why the exact same query works for one return and not the other?

 

pml var return focus

garythomannCoGC_0-1692230937155.png

 

pml_id return focus

garythomannCoGC_1-1692231002189.png

 

Hilarious, now expand the query and new focus works!?   

garythomannCoGC_0-1692231941994.png

==================================================================

Why no data returned when  'Measure Benefit Master'[PM IDId] = 3921  in the dataset shows 4 rows?

Try with direct literal.

garythomannCoGC_0-1692232856212.png

dataset table mbm.PM IDId  filtered for 3921

garythomannCoGC_1-1692232918212.png

>>  answer is lack of data integrity in the data,   'Measure Benefit Master'[DIR] = "CO"   has different values, remove and working :}

==================================================================

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Just catching up with your question here 🙂

One key point: DAX queries can only return tables, not scalar values.

So RETURN pml will result in an error in the above queries.

 

Contrast with measures that must return scalar values.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Just catching up with your question here 🙂

One key point: DAX queries can only return tables, not scalar values.

So RETURN pml will result in an error in the above queries.

 

Contrast with measures that must return scalar values.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.