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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Twitter
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
Twitter
LinkedIn

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.