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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

SELECTEDVALUE in Direct Query from SAP BW

Hi,

Currently, I am using the data from SAP BW source using Direct Query method.

My requirement is : We have multiple slicers regarding Month, Quarter , Year in report and One card should be added on top of report.Whenever user will select any slicer using (Quarter, Month,Year), Based on the selection ,Selected Value of  "Quarter &Year' or "Month&Year" should display in that card.

But I am facing the issue with the SELECTEDVALUE and ISFILTERED using this data source. 

Does anyone has any idea how to capture the selected value of slicers when working with SAP BW in Direct Query?

Any suggestions would be helpful 🙂

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

You could create a measure like the formula below. The values that are from the two functions need to be matched with your slicer. And for multiple slicers in your report, you could change IF function to SWITCH.

Month &Year = 
var Mon = SELECTEDVALUE('Table'[Month])
var Ye = SELECTEDVALUE('Table'[YEAR])
return
IF(ISFILTERED('Table'[Month]) && ISFILTERED('Table'[YEAR]),Mon&" & "&Ye,BLANK())

Quarter & Year = 
var Quar = SELECTEDVALUE('Table'[Quarter])
var Ye = SELECTEDVALUE('Table'[YEAR])
return
IF(ISFILTERED('Table'[Quarter]) && ISFILTERED('Table'[YEAR]),Quar&" & "&Ye,BLANK())

5.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

You could create a measure like the formula below. The values that are from the two functions need to be matched with your slicer. And for multiple slicers in your report, you could change IF function to SWITCH.

Month &Year = 
var Mon = SELECTEDVALUE('Table'[Month])
var Ye = SELECTEDVALUE('Table'[YEAR])
return
IF(ISFILTERED('Table'[Month]) && ISFILTERED('Table'[YEAR]),Mon&" & "&Ye,BLANK())

Quarter & Year = 
var Quar = SELECTEDVALUE('Table'[Quarter])
var Ye = SELECTEDVALUE('Table'[YEAR])
return
IF(ISFILTERED('Table'[Quarter]) && ISFILTERED('Table'[YEAR]),Quar&" & "&Ye,BLANK())

5.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.