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
Syndicate_Admin
Administrator
Administrator

I can't reference a table and column from a measurement

I have loaded in a table (visual element within the canvas of power bi) a list of cities, and I need to apply a calculation depending on the city that appears, for example if the city is Malaga I need to apply to an amount a little percent (let's say that for Malaga it is (3%). But if it appears in the Cadiz table I need you to do the same by multiplying it by 4%.

I tried to use the function as follows... if(MAX('Mu Papel Id Caras ADHOC'[City] = "MALAGA"), (nunVentas/ventas)*3% but indicates the following error "the Max function only accepts a column reference as an argument"

So I have chosen to make a Switch and evaluate the cities but I do not recognize the table or the column to which I refer (this has never happened to me the truth) and I have looked at the table and it is well written

If for example I call the table and column with the sum function links without problems but with the example that I put below there is no way to reference it

Maybe it's silly, but do you know why this can happen?

I pass you screen print of the measure with the error that gives me and the table with that column

JaviBI_0-1661857799858.png

JaviBI_1-1661857808937.png

Greetings and thanks

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Syndicate_Admin ;
Here (where the red label is) there is one less right parenthesis so the measure is incorrect.

vyalanwumsft_0-1662359659576.png

Or 

Prueba =
IF (
    MAX ( 'Mu Papel ID Caras'[Ciudad] ) = "MALAGA",
    400 / 5 * 0.03,
    IF ( MAX ( 'Mu Papel ID Caras'[Ciudad] ) = "CADIZ", 400 / 5 * 0.04 )
)


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @Syndicate_Admin ;
Here (where the red label is) there is one less right parenthesis so the measure is incorrect.

vyalanwumsft_0-1662359659576.png

Or 

Prueba =
IF (
    MAX ( 'Mu Papel ID Caras'[Ciudad] ) = "MALAGA",
    400 / 5 * 0.03,
    IF ( MAX ( 'Mu Papel ID Caras'[Ciudad] ) = "CADIZ", 400 / 5 * 0.04 )
)


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PaulDBrown
Community Champion
Community Champion

Try:

 

Prueba =
SWITCH (
    MAX ( 'Mu Papel ID Caras'[Ciudad] ),
    "MALAGA", DIVIDE ( 400, 5 ) * 0.03,
    "CADIZ", DIVIDE ( 400, 5 ) * 0.04
)

 

You can of course change the DIVIDE expressión to include the pertinent measures:

 

DIVIDE ( [Measure 1], [Measure 2])

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@Syndicate_Admin , A measure can not use not summarized columns .

 

Put your code inside sumx or maxx

 

 

Sumx('Mu Paper ID Caras ADHOC', 

<Your Sitch Code>

)

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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