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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
anandav
Skilled Sharer
Skilled Sharer

How to display a DAX variable table in Power BI Table visual

Hi All,

I am using DAX variables in a measure to:

- Create temperary CALCULATEDTABLE bases on user slicer selections

- Use set functions to derive a resulting table

 

The requirement is to be able to display the resulting table. I cannot pre-load these as M query tables as these are caluclated based on user slicer selection.

 

In DAX Studio query I can do the following to return the rows of the resulting table:

DEFINE
    var AllNumbers = {1,2,3,4,5}
    var OddNumbers = {1,3,5}
    var EvenNumbers = EXCEPT(AllNumbers, OddNumbers)
EVALUATE
    EvenNumbers

 

How can I achieve the similar results in Power BI to diplay the results in a Table visual?

 

 

 

3 REPLIES 3
PhilipTreacy
Super User
Super User

Hi @anandav 

 

Download sample PBIX file

 

Create a new table and display in a visual

newtab3.png

 

NewTable = 

    var AllNumbers = {1,2,3,4,5}
    var OddNumbers = {1,3,5}
    var EvenNumbers = EXCEPT(AllNumbers, OddNumbers)

RETURN

    EvenNumbers

 

vals3.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi Phil,

Thanks for the reply.

But as I mentioned in question, this is dynamic table created in a measure based on user slicer selection.

Therefore it cannot be pre-created as new table.

Hi @anandav 

Did you find a solution in the end ? 
I'm trying to achieve exactly the same thing you're discribing in your post.
Any help would be appreciated.

Cheers !

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.