Forum Discussion
Values for a measure does not show up
Hi Experts!
I have three tables in PowerBI desktop.
Contract: Business, Site_ID, Contract_ID
Date: DateID, Date
Sales: DateID, Contract_ID, Amount
Sales account is connected to other two tables based on DateID and Contract_ID. I need to get a Month-to_date summary on Business level and Site_ID level.
But the logic is, MTD values on Site_ID level, final daily MTD value should be positive. So all negative values should show as positive.
Then in Business level, all Site_ID level values should be added. That is all positive values should be added.
I added a measure and it works fine.
MTD =
CALCULATE(
SUMX(FILTER(Contract, Contract[Business] = SELECTEDVALUE(Contract[Business])),
IF(TOTALMTD(SUM(Sales[Amount]),Date[DATE])<0,TOTALMTD(SUM(Sales[Amount]),Date[DATE])*(-1),TOTALMTD(SUM(Sales[Amount]),Date[DATE]))),
ALLSELECTED(Contract[Business])
)
But when I get this measure to a visual, the values are blank.
When i get a summary by Site_ID level, for some Site_IDs values show. For some nothing shows. BLANK.
I checked the relationships also, and those looked fine to me.
Can someone please help
Anonymous , try like
Sumx(summarize(Sales, Contract[Business], Contract[Site ID]) , calculate(abs( TOTALMTD(SUM(Sales[Amount]),Date[DATE]))))
1 Reply
- amitchandak
Super User
Anonymous , try like
Sumx(summarize(Sales, Contract[Business], Contract[Site ID]) , calculate(abs( TOTALMTD(SUM(Sales[Amount]),Date[DATE]))))