Forum Discussion
Calculate max value with conditions
Hi,
I have a problem with calculating max value witch is in special condition.
Expected result column x
all value between columns -20 till 20 calkulating by measure depending from t (is column in tale) and I want to calculate value in column x wich is a max value in row and must be > than value column and < than value from next column, else is 10
11 Replies
- daXtreme
Solution Sage
Hi andrieskoo
I've had a look at the file... Is this at all a PBI model or just a data dump? All the tables are disconnected in there, which makes me think the author does not yet fully understand the basic dimensional modeling principles Power BI is based on. My kind advice would be to first focus on some PBI theory, then on building a good dimensional model (which is always crucial to producing good correct numbers) and then on starting writing correct measures. As it currently stands, this solution will fall apart sooner than anyone thinks.
- tamerj1
Community Champion
Hi andrieskoo
what are the matrix columns from -20 to 20? Are they values in a column in your data or measures? What are the columns invloved in the rows of your matrix visual? Please provide sample data with the code of your measure(s).
- andrieskooFrequent Visitor
tamerj1 ,
columns from -20 to 20 is value from another table (not in relationship with table witch have column "Kod"), and it is measure
and one of measure wich is related to earch column isAnd I calculate this value (for earch temperature) adding column "Temperatura zewn." to wisualization
- tamerj1
Community Champion
what is under "kod" in the matix hierarchy?
- andrieskooFrequent Visitor
tamerj1 ,
it could be deleted
I need only this max value for "Kod" columns, all this temperature (-20 to 20) could be hiden
pehaps, I must calculate "x_pompy" in measure, witch calculate max value, but I do not know how - andrieskooFrequent Visitor
I calculate, but how calculate all in measure, not adding "Temperatura zewn" colunm to wizualization?
Because when I remove column "Temperatura zewn" result of measure gone (they are based on this temperature)- tamerj1
Community Champion
Hi andrieskoo
One option is to have this value in the rows grand total of your original matrixYou can use a new measure
New Measure = IF ( HASONEVALUE ( _Budynek[Temperatura zewn] ), [Fist Measure], [2nd Measure] )
- andrieskooFrequent Visitor
How to display same result without Temperatura zewn kolumn in visualization?
- tamerj1
Community Champion
Can you please share a sample file?
- andrieskooFrequent Visitor