Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi I need to calculate day over day
I attached the pbix file https://1drv.ms/u/s!Amd7BXzYs7AVhBBCo_Ls7q5IkrXH?e=d1nNmA
I've tried the following calculated measure but actually it returns wrong values, it returns sales for current date, but I need to return sales for previous day. How to correct it?
Solved! Go to Solution.
@Anonymous , With help from date table try measures like
This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Last Day = CALCULATE(sum('Table'[Qty]), previousday('Date'[Date]))
diff =[This Day] - [Last Day]
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c3243d1f9
If we want to have data of selected period of Current Period and its corresponding previous period (eg. if we select [(02-02-2015 to 02-02-2016 the data of previous year 02-02-2014 to 02-02-2015 should display nearby graph in shadow mode)]
@Anonymous , With help from date table try measures like
This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Last Day = CALCULATE(sum('Table'[Qty]), previousday('Date'[Date]))
diff =[This Day] - [Last Day]
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c3243d1f9
@amitchandak I should display 0 even if there's no data for all dates selected in the date range slicer, what you propose does not work.
@Anonymous , if you add +0 to measure that should do .
One more solution for that for between date range
0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))
Sorry, Seem like did not get it completely
@amitchandak actually I add 0 but it doesn't work. Please check the pbix attached to my question.
User | Count |
---|---|
98 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
58 |