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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lilian7300
Frequent Visitor

using SELECTEDVALUE in a calaulated table

Hi,

 

I met the following problem, appreciate if anybody can help with that.

1. I create a table with the following DAX code:
SlicerValue = GENERATESERIES(1,10)
2. I use SlicerValue as a slicer

3. I use a measure called cal1

cal1 =
var v1=SELECTEDVALUE(SlicerValue[Value])
return sumx(Cal,Cal[Value]*v1)
 
it returns the correct result I want.
813-1.PNG
 
 
 
 
 
 
 
 
 
 
 
 
4. I want to create a calculated table:
Table =
SELECTCOLUMNS(Cal,"cal1",Cal[cal1])
813-2.PNG
 
 
 
 
 
 
 
 
 
 
 
The result is  blank. What I expect is it should display the values like (8,12,16,20,24...) .
How can I make it work?
4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

While you can't make a calculated table that is dynamic to your slicer, but you can make a virtual table in a measure like this one.

 

VirtualTableMeasure =
VAR v1 =
SELECTEDVALUE ( SlicerValue[Value] )
VAR _table =
ADDCOLUMNS ( GENERATESERIES ( 1, 10, 1 ), "@value", v1 * [Value] )
RETURN
SUMX ( _table, [@value] )
// or do some other analysis on this virtual table

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thanks for your reply. I tried your DAX code but it comes the error message "The expression specified in the query is not a valid table expression."

 
VirtualTableMeasure =
VAR v1 =SELECTEDVALUE ( SlicerValue[Value] )
VAR _table =
ADDCOLUMNS (GENERATESERIES( 1, 10, 1 ), "@value", v1 * [Value])
RETURN
SUMX ( _table, [@value] )
 
 
813-3.PNG

 

amitchandak
Super User
Super User

@lilian7300 , Measure used in the table will not respond to selected values.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

So sad to hear that, it's very important for me to develop a dynamic calaulated report.

 

Why Power BI can't do that???

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.