Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Need to create cumulative Total in PowerBI bar chart. I need to show January sales 1000$ as fixed and Feb, march cumulative value should be calculated based on data.I have already tried below dax but no luck so far:
Comulative Total =
VAR Baseline = CALCULATE(
COUNT('Sales'[sales_amount]),
FILTER(
ALLSELECTED('Sales'[Year_Month]),
'Sales'[Year_Month]="Oct-2020"))
VAR NUM = CALCULATE (
SUM ( 'Sales'[sales_amount] ),
FILTER (
ALLSELECTED( 'Sales' ),
'Sales'[YM] <= MAX ( 'Sales'[YM] )
)
)
RETURN Baseline+NUM
Here is expected output
Month | Actual Sales(Sale_amount) | Expected Comulative Total | % Change from January |
Jan | 115 | 1000 | 0 |
Feb | 100 | 1100 | 0.1 |
Mar | 50 | 1150 | 0.15 |
April | 100 | 1250 | 0.25 |
May | 200 | 1450 | 0.45 |
June | 100 | 1550 | 0.55 |
Solved! Go to Solution.
@Anonymous , If you have date you can Cumm Sales
Cumm Sales = CALCULATE(SUM(Table[Sale_amount]),filter(allselected(Table),Table[Date] <=max(Table[Date])))
For Change %
MTD Sales = CALCULATE(SUM(Sales[Sale_amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sale_amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])
Prefer to use Date Table
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
@Anonymous , If you have date you can Cumm Sales
Cumm Sales = CALCULATE(SUM(Table[Sale_amount]),filter(allselected(Table),Table[Date] <=max(Table[Date])))
For Change %
MTD Sales = CALCULATE(SUM(Sales[Sale_amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sale_amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])
Prefer to use Date Table
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
User | Count |
---|---|
84 | |
79 | |
69 | |
46 | |
43 |
User | Count |
---|---|
106 | |
50 | |
49 | |
40 | |
39 |