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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

DAX- How to return selected measure values in a table?

Hi All,

 

----please refer below picture------

I am trying to create a measure that, if I select anything from Product Name filter visual, it will return (%)PRODUCT Measure, if there isnt anything selected in Product Name filter visual then it will return (%)SUB-PRODUCT Measure.  

 

Below case, I tried to use ISFILTER Function like below;

Measure =
        IF (ISFILTERED(PRODUCT[PRODUCT_NAME]),(%)PRODUCT,(%)SUB-PRODUCT) 
 

 

WHynotbi61_0-1659630451445.png

 

And, it didnt work.  I didnt select anything from filter visual, but it is returning (%)PRODUCT. 

 

Note: I need to keep PRODUCT NAME in the table

 

Do you have any solution?

 

Thank you!

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Product name is used in visual, so isfiltered is true because of that

 

try like

var _is = calculate(ISFILTERED(PRODUCT[PRODUCT_NAME]), allselected())

return

IF (_is ,(%)PRODUCT,(%)SUB-PRODUCT)

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Product name is used in visual, so isfiltered is true because of that

 

try like

var _is = calculate(ISFILTERED(PRODUCT[PRODUCT_NAME]), allselected())

return

IF (_is ,(%)PRODUCT,(%)SUB-PRODUCT)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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