Forum Discussion

Yaru's avatar
Yaru
Regular Visitor
2 years ago
Solved

PowerBI - visualization settings issue

hello Dears, Below table is my RAW Data. The number of Enrolled Users is increasing, while the number of Unenrolled Users is decreasing month by month.   Location Jan-24 Feb-24 Mar-...
  • Anonymous's avatar
    Anonymous
    2 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!