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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yoav20007
Helper II
Helper II

How to get the value of the selected row in the table to a var in dax?

i wont to creat a table base of the selected row of other table .
this code give me a empty table.
pls help 🙂 

Thanks

Yoav

filter table.PNG

Table =
var myprice= [TotalPrice]

var mydate=SELECTEDVALUE('Sheet1'[Date])
return

FILTER('Sheet1',
'Sheet1'[Price]<Myprice && 'Sheet1'[Date]=mydate)
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Tables are not dynamic, they are only calculated at the time of data load.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
CloudJoh
New Member

Hi, what you want to do is not possible in PowerBI at the moment. 
However, I just found a way to do it, albeit a bit complicated. And you'll need a sharepoint folder for this to work. 
1. Create a Power automate component that takes in your selected value as data
2. Create a Power Automate Cloud flow that : 
   2.1 check if there is an excel file existing for that session, if no, creates one

   2.2 adds a line into the excel file for that session containing the selected value 
   2.3 actualises the data for that source only
3. create your second table using that excel as your source. 
This will require pushing a button everytime you want to add a line but it works very well. 

Greg_Deckler
Super User
Super User

Tables are not dynamic, they are only calculated at the time of data load.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

if i changing the var to a number the table work good

in this case i does what i want
I think i need to change the var line to a measure ?

filter table2.PNG

The resualt shout be a table. 
how can i filter 1 table and save the resualt as a new table . like an advance  filter in Excel ? 

 

Thank

So, how can i do it dynamic? 
do you have a sulotion to do it?

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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