Forum Discussion
If condition
Hi Anonymous
Basically Measurs dont work with row context so you need to use MAX or MIN, something like below.
If MAX(column month )> = MONTH( TODAY() );sum(X);sum(y)
Please read the article below for more info.
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Mariusz
I try
"Dax comparison operations do not support comparing values of type text with values of type integer."
Doc_Factura[Mês],month(today()), Facturação bruta; sumValorPub are integers and decimals so I don't understand the error.
I try to make a new column with funtion value but the error was the same
- Cmcmahan7 years agoResident Rockstar
Check your tables. Make sure that PBI recognizes that Doc_Factura[Mes] is an integer value and not a string.
Otherwise, using VALUE should have worked to force a type change.- Anonymous7 years agoNot applicable
I already check and it is a integer, that's why I don't understand the error..even if it wasn't the value function should change the type to integer.
- Cmcmahan7 years agoResident Rockstar
It should, which is why we get to debug this to figure out what's happening.
I know it's obnoxious, but can you make a few new measures, to show what value is being returned at each step?
Test1 = MAX(Doc_Factura[Mês])
Test2 = MONTH(TODAY())
Test3 = [Test1]>=[Test2]
Test4 = [Facturação Bruta]Test5 = [ValorSumPub]
Hopefully when you put these into a table, all the results make sense, but if there's one that doesn't work properly, we can focus in on that one. As of right now, I have no idea where your problem is. It all looks like it should work.