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
joshua1990
Post Prodigy
Post Prodigy

SELECTEDVALUE shows every row

Hello everyone!

I have a simple Measure, that should show me a specific attribute of our Attribute Master for a Sales Order.

Unfortunately, this measure shows me every attribute of the attribute column. Maybe something is not clear with the data model.

The model has the following structure:

tblAttribute

ProductAttribute 1Attribute 2Attribute 3
111XYZ

 

tblSales

OrderProductDate
100-0111101.08.2020

 

tblSalesRouting

OrderStateDateValue
100-014001.08.2020500
100-019506.09.2020320

 

The tblSales is linked with the Product column to the tblAttribute (Many-to-One > Single).

The tblSalesrouting is linke with the Order column to the tblSales (Many-to-One > Single).

 

Now I need a measure that shows me the Attribute 1 for each Order.

How would you build this?

1 REPLY 1
CNENFRNL
Community Champion
Community Champion

Hi, @joshua1990 , you may want to try this measure,

 

 

 

Attr1 via tblSales = CALCULATE ( MAX ( tblAttribute[Attribute 1] ), CALCULATETABLE ( tblSales ) )

 

 

As you know, DAX expression is subject to data model in a very delicate way, this measure does the trick when you select tblSales[Order] in a table/matrix viz.

 

If tblSalesRouting[Order] is used, you might want to try this measure instead,

 

 

Attr1 via tblSalesRouting = CALCULATE ( MAX ( tblAttribute[Attribute 1] ), CALCULATETABLE ( tblSalesRouting ) )

 

 

 

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

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.