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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
andrieskoo
Frequent Visitor

Calculate max value with conditions

Hi,
I have a problem with calculating max value witch is in special condition.

Expected result column x

andrieskoo_0-1649010290287.png

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 11
daXtreme
Solution Sage
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.

andrieskoo
Frequent Visitor

How to display same result without Temperatura zewn kolumn in visualization?

Can you please share a sample file?

@andrieskoo 
I spent a while looking into it but apparently could not understand almost anything. That is beyond my capabilities. Apologies for not being able to serve you properly. 

andrieskoo
Frequent Visitor

I calculate, but how calculate all in measure, not adding "Temperatura zewn" colunm to wizualization?

andrieskoo_0-1649022929148.png

Because when I remove column "Temperatura zewn" result of measure gone (they are based on this temperature)

andrieskoo_1-1649023059907.png

 

 

Hi @andrieskoo 
One option is to have this value in the rows grand total of your original matrix
andrieskoo_0-1649020021910.png

You can use a new measure 

New Measure =
IF ( HASONEVALUE ( _Budynek[Temperatura zewn] ), [Fist Measure], [2nd Measure] )
andrieskoo
Frequent Visitor

@tamerj1 ,
it could be deleted

andrieskoo_0-1649020021910.png


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

tamerj1
Super User
Super User

@andrieskoo 

what is under "kod" in the matix hierarchy?

andrieskoo
Frequent 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 

andrieskoo_2-1649017321441.png


and one of measure wich is related to earch column is

andrieskoo_0-1649017161678.png

And I calculate this value (for earch temperature) adding column "Temperatura zewn." to wisualization

andrieskoo_1-1649017272883.png

 

tamerj1
Super User
Super User

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). 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors