Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi
I have Four Tables, Calendar, Location, Sales and Targets. They have Relationships with like one to many as below
Calendar Date with Sales Date
Calendar Date with Targets Date
Location ID with Sales Location ID
Location ID with Targets Location ID
I am Trying to achieve a result through Measure with Conditions that if the Calendar Month is < Current Month then It should Some Sales Table Amount Column, Otherwise Targets Table Amount Column. Now when I put both Measures on Table Matrix with Year and Month on Rows and Conditional Measure on Column, Month By Month it gives the right Calculation but on total level it is giving incorrect Amount.
I am Using the Following Simple If Logic
As per the above image the value on each month level is correct but the total is wrong, instead of summing up the visual values in the column it is applying the conditional logic to the totals level which is wrong. It should sum up to 143,809,001.
We have tried summing it up through summarize and sumx but due to limited knowlede we are not able to resolve it. Please help!
Thanks in Advance
Solved! Go to Solution.
This can be handled with a separate totals measure. I'm assuming your date table has a [Year Month] column (or similar). If not, it's worth adding to your date table.
Base Measure =
IF (
MONTH ( MAX ( 'Calender 2'[Date] ) < MONTH ( TODAY () ) ),
SUM ( 'Value Entry Stock All Items'[Sales Amount (Actual)] ),
SUM ( Targets[JAN Target] )
)
Total Measure =
SUMX ( VALUES ( 'Calender 2'[Year Month] ), [Base Measure] )
Proud to be a Super User!
This can be handled with a separate totals measure. I'm assuming your date table has a [Year Month] column (or similar). If not, it's worth adding to your date table.
Base Measure =
IF (
MONTH ( MAX ( 'Calender 2'[Date] ) < MONTH ( TODAY () ) ),
SUM ( 'Value Entry Stock All Items'[Sales Amount (Actual)] ),
SUM ( Targets[JAN Target] )
)
Total Measure =
SUMX ( VALUES ( 'Calender 2'[Year Month] ), [Base Measure] )
Proud to be a Super User!
Thanks @DataInsights !! It worked for me.. Could you please explain whats happeneing in back end..
Thank you for this solution that I saw the same too. I wanna know why you use [Year Month]
The field [Year Month] provides uniqueness (based on the provided screenshot) in a single field. Otherwise, you would need to summarize unique combinations of Year and Month.
Proud to be a Super User!
I see. Thank you for your descriprtion. 😊
Hello @DataInsights ,
Athough your answer is over a year old, it helped me really a lot. I had a measure that was not calculating the total in a good way. After seraching in the community I tried your answer and with some modification it worked just fine. Now the totals are right, so if the customer need the min/max etc. it also worked.
Keep up answering, thanks a lot.
With kind regards,
Martin
Thanks for the feedback! Glad to hear this solution helped. See the solution below for a different approach that uses KEEPFILTERS.
On a side note, consider using DIVIDE instead of the division operator to handle division by zero. Good luck!
Proud to be a Super User!
Thaank u sooo much bro! It worked for me.
Thank u soooo much Bro. It worked for me.
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
105 | |
93 | |
83 | |
64 |