Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

PowerBI DAX集計 メモ

表示範囲内での累計

DAX
MTD_amount = 
CALCULATE(
    SUM('daily_sales_summary'[amount]),
    FILTER(
        ALLSELECTED('daily_sales_summary'),
        ISONORAFTER('daily_sales_summary'[date], MAX('daily_sales_summary'[date]), DESC)
    )
)

365日移動平均(※当日は含めない)

DAX
ma_amount = 
VAR interval = -365
RETURN
CALCULATE(
    SUMX('daily_sales_summary', 'daily_sales_summary'[amount]) / DISTINCTCOUNT('daily_sales_summary'[amount]),
    DATESINPERIOD(
        'daily_sales_summary'[amount],
        LASTDATE('daily_sales_summary'[amount])-1,
        interval,
        DAY
    )
)

※含める場合は-1を削除

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away