Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Hello,
I want to divide the latest AR value with sum of Salesand then multiply it with number of Days. But when I am dividing it with total sales value it is automatically dividing it with all week sales. I am attaching my data as well as outcome I want to have. Kindly have a look at it. A help would be highly appreciated.
Thank you
Weeknum | Sales | AR | Days in week |
1 | $ 594,935.76 | $ 343,466,767 | 7 |
2 | $ 423,051.96 | $ 67,955,894 | 14 |
3 | $ 378,467.79 | $ 568,569 | 21 |
4 | $ 379,376.90 | $ 8,990,955 | 28 |
5 | $ 459,192.74 | $ 17,413,341 | 35 |
6 | $ 1,065,006.10 | $ 25,835,727 | 42 |
7 | $ 642,491.90 | $ 5,201,533 | 49 |
Outcome I need is for week 7 it would be ($ 5,201,533/$ 3,942,523.15) * 49 = 64.533
64.533 would be the outcome for week 7.
Solved! Go to Solution.
Hi @Junaid11 ,
You can create a measure as below to get it, please find the details in the attachment.
Measure =
VAR _selweek =
SELECTEDVALUE ( 'Table'[Weeknum] )
VAR _sales =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER ( ALL ( 'Table' ), 'Table'[Weeknum] <= _selweek )
)
VAR _ar =
CALCULATE (
SUM ( 'Table'[AR] ),
FILTER ( 'Table', 'Table'[Weeknum] = _selweek )
)
VAR _days =
CALCULATE (
MAX ( 'Table'[Days in week] ),
FILTER ( 'Table', 'Table'[Weeknum] = _selweek )
)
RETURN
DIVIDE ( _ar, _sales ) * _days
Best Regards
Hi @Junaid11 ,
You can create a measure as below to get it, please find the details in the attachment.
Measure =
VAR _selweek =
SELECTEDVALUE ( 'Table'[Weeknum] )
VAR _sales =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER ( ALL ( 'Table' ), 'Table'[Weeknum] <= _selweek )
)
VAR _ar =
CALCULATE (
SUM ( 'Table'[AR] ),
FILTER ( 'Table', 'Table'[Weeknum] = _selweek )
)
VAR _days =
CALCULATE (
MAX ( 'Table'[Days in week] ),
FILTER ( 'Table', 'Table'[Weeknum] = _selweek )
)
RETURN
DIVIDE ( _ar, _sales ) * _days
Best Regards
Hi @Junaid11
Please try this
Proud to be a Super User! | |
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
91 | |
86 | |
83 | |
76 | |
49 |
User | Count |
---|---|
145 | |
140 | |
109 | |
68 | |
55 |