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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Measure not recognizing columns

I am very inexperienced with DAX and I get confused when I try to create a measure and I cant reference a coulmn from a table that I want.

 

For example if i want to use an "If" Statement with a date it wont let me reference the date column or the date table.

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

If you reference a column in a measure, you must wrap the column in an aggregation function like MIN, MAX, SUM, AVERAGE, etc.



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

9 REPLIES 9
MDKCLIRResearch
Helper III
Helper III

Why bother having a DAX function named TRIM() if it cannot find any text column that you supply?  What is the point?

Greg_Deckler
Super User
Super User

If you reference a column in a measure, you must wrap the column in an aggregation function like MIN, MAX, SUM, AVERAGE, etc.



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hello, 

I have a question concerning your solution. I want to get the value of "visit24hrs" for today for each title in my report. I now used this formula: 

result = CALCULATE(SUM(AnalyticsView[Visits24h]), FILTER(ALL( AnalyticsView), (Date(2023,03,02) = AnalyticsView[Date]))) 

In my chart I use for Y Title and for X result. BUT then I get the same number (the summed result) for each Title. 
Question: How can I display the result for an Item in my chart? Without the "sum" in the formula I am not able to use Visits24hrs in the measure (it says it can not regognize the column)

 

@Greg_Deckler I have the same issue but I'm not sure I understand your solution.

I'm trying to use Switch(True() to have conditions on a date column before some calculations, but it's not working as you can see below:

Aymane_0-1651069304080.png

 

Anonymous
Not applicable

What does it mean to wrap them?  I am having this issue as well.

you have to do it like that: 

Measure = sume(table[column])

Anonymous
Not applicable

Any idea if there's a similar solution for string/text values?

 

I'm having a lot of trouble with creating logical expressions based on text in measure fields.

Anonymous
Not applicable

Thanks for the reply, that makes a lot of sense now

Where is the solution to this? Having the same problem.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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