Forum Discussion
Return text value based off condition
- 5 years ago
Hi FatBlackCat30 ,
Try this measure,
Latest QTR = CALCULATE(MAX('Table'[QTR]),Filter(all('Table'),'Table'[date]=MAX('Table'[date])))
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel - 5 years ago
FatBlackCat30 , if you want to select a date(slicer) datesqtd can help. If you do want to select then stop your date calendar on today.
With date calendar and date in slicer
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date]))) Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER))) Last complete QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER)))) Last to last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-2,QUARTER)))Else you need qtr start date in the calendar
Try like
Measure =
var _min = minx(allselected('Date') , 'Date'[Qtr Start Date]) //refer to blog to get this
var _min = maxx(allselected('Date') , 'Date'[Date])
return
calculate(countrows('Table'), Filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max ))
Measure =
var _min = minx(allselected('Date') , 'Date'[Qtr Start Date]) //refer to blog to get this
var _min = maxx(allselected('Date') , 'Date'[Date])
return
calculate(countrows('Table'), Filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max ))For Qtr Start Date
Creating Financial Calendar - From Any Month
https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calendar-1-5-Power/ba-p/1187441
thank you Nathaniel_C & amitchandak both exellent solutions. I almost had it working, I just missed a small part