Forum Discussion
DAX calculation in a different context
- 7 years ago
Hello nmaddock
You can use ALLSELECTED over your table to achieve your goal.
KG's Per M3 = IF ( NOT ISBLANK ( [Total Weight] ), CALCULATE( DIVIDE([Total Weight], DIVIDE([Total Volume],1000)) ,ALLSELECTED(Agreement) ) )
Hello nmaddock
You can use ALLSELECTED over your table to achieve your goal.
KG's Per M3 =
IF ( NOT ISBLANK ( [Total Weight] ),
CALCULATE(
DIVIDE([Total Weight],
DIVIDE([Total Volume],1000))
,ALLSELECTED(Agreement)
)
)
- nmaddock7 years agoHelper I
That worked perfect, thank you :-) its easy when you know how
- nmaddock7 years agoHelper I
Hi jdbuchanan71
I've updated the report but I'm getting gaps where there should be the same value, is this due to the other tables in my report?
Please find the link to the updated report:
https://www.dropbox.com/s/4gizjerw7ddd23k/Power%20BI%20Sample.pbix?dl=0
Many Thanks for your help.
Nathan
Many Thanks Nathan
- jdbuchanan717 years agoSuper User
Hello nmaddock
Because the [KG's Per M3] measure needs [Total Weight] and [Total Volume] and on those line with blanks there is no weight or volume we get blank. What would be the basis of the calculation for those lines? Meaning, what should it be and how did you get to that number?
- nmaddock7 years agoHelper I
The KG's Per M3 is supposed to be based on all the jobs of an industry type, for Cafe is think it was 91.15. so as long as the agreement is of type Cafe I want the 'KG's Per M3' for that industry type to be displayed.