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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ells69
Helper I
Helper I

How to populate the DAX in a measure from a data column

I have a formulas table

ID MeasureName DAXFormula

1       Total Sales            SUM('Sales'[Amount])
2       Total Cost             SUM('Cost'[Amount])
3        Profit                   [Total Sales] - [Total Cost]

What I want is my data set to have the measures already there and then the values come from the formula.
SO when I load \refresh the data if the values in the DAX formula have changed then the measures change.

Kind of like the old dynamic SQL

DECLARE @SQL nvarchar(1000)
declare @Pid varchar(50)
set @pid = '680'
SET @SQL = 'SELECT ProductID,Name,ProductNumber FROM SalesLT.Product where ProductID = '+ @Pid
 
EXEC (@SQL)
2 REPLIES 2
ells69
Helper I
Helper I

ok
Cant upload the link as the address contains sensitive info 

tried to add screen shots but that did not work either

It is self explanatory in the post, Can you populate the DAX of a measure from a table in Power BI?

 

foodd
Super User
Super User

Hello @ells69, and thank you for sharing your question with the Community.  Remember to adhere to the decorum of the Community Forum when asking a question.

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

 

If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.  Proud to be a Super User!

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Kudoed Authors