Forum Discussion

NW953's avatar
NW953
Frequent Visitor
2 years ago
Solved

TOPN with variable for N_Value

I have software usage data and depending of the software type we want to assign the TOPN users to discounted seats.... The number of discounted seats we have varies by software type... At the end I h...
  • ahadkarimi's avatar
    ahadkarimi
    2 years ago

    Hey NW953, try this one and let me know if there is any problem.

    Forecast PDM Discount Seat Cost =
    var N_Value = MIN(Usage[Discounted Seats])
    var PDM_Disc_Users =
    TOPN(N_Value,ALLSELECTED(Usage[email]),
    [PDM Usage],DESC)
    RETURN
    CALCULATE(sumx(
    values(Usage[email]),
    min(Usage[PDM Discount Seat Cost])),
    filter(VALUES(Usage[email]),Usage[email] IN PDM_Disc_Users))