Forum Discussion
PowerBI - visualization settings issue
- Anonymous2 years ago
Hi Yaru
Based on the current data you show, you can also try this measure and use it in your donut chart visual. The logic to get the last month is through the _lastMonth variable which gets the last date in your table and convert it into yyyymm format.
UserCount Measure = var _lastMonth = FORMAT(MAX('Table'[Date]),"yyyymm") return IF(ISFILTERED('Table'[Date]),SUM('Table'[Users Counts]),CALCULATE(SUM('Table'[Users Counts]),FORMAT('Table'[Date],"yyyymm")=_lastMonth))Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Hi Yaru
Based on the current data you show, you can also try this measure and use it in your donut chart visual. The logic to get the last month is through the _lastMonth variable which gets the last date in your table and convert it into yyyymm format.
UserCount Measure =
var _lastMonth = FORMAT(MAX('Table'[Date]),"yyyymm")
return
IF(ISFILTERED('Table'[Date]),SUM('Table'[Users Counts]),CALCULATE(SUM('Table'[Users Counts]),FORMAT('Table'[Date],"yyyymm")=_lastMonth))
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
many thanks Jing, it works for me, that's what i want❤️