Forum Discussion
Average payment for previous month
- 8 years ago
I downloaded and looked at your file. Only change I see to make is to remove the ".Date" part. Try this:
Avg_PreviousMonth_payment = CALCULATE ( AVERAGE ( DataFromDB[Payment_Amt] ), PREVIOUSMONTH ( CalendarTable[Date] ) ) - 8 years ago
One way to reduce is:
Creating a calculated column in your calendar table
DaysinMonth = DATEDIFF ( STARTOFMONTH ( CalendarTable[Date] ); ENDOFMONTH ( CalendarTable[Date] ); DAY ) + 1And in the measure:
TotalPayment_PreviousMonth = VAR DaysinPrevMonth = CALCULATE ( SELECTEDVALUE ( CalendarTable[DaysinMonth] ); PREVIOUSMONTH ( CalendarTable[Date] ) ) RETURN DIVIDE ( CALCULATE ( SUM ( DataFromDB[Payment_Amt] ); PREVIOUSMONTH ( CalendarTable[Date] ) ); DaysinPrevMonth )Regards
Victor
Lima - Peru
mattbrice, Switch is enough since it only shows the measure chosen. That is exactly what I am looking for.
For text box, it is no problem since I will put the slicer aside the measure and user will know which average measure they choose.
Thanks so much again for your quick reply.
Further requirement for this project. Need layout like below
But in power bi those 9 numbers are from 9 different measures. The layout I got so far frow power BI is below.
All the texts are from text boxes and numbers are from multirow card without catagory lable.
But in this way, I can't adjust the distance bewteen row and columns and can't add gridline on columns or rows. What is best way to do it? Thanks for help.