I'm started to use DAX and I need some help please.
Actualy I'm trying to multiply a measure which is a total of measure values obtained by using Removefilters function, by a calculated column (month number).
Measure : Baseline = calculate(SUMX('FACT_NCM_QFRZ', IF(RELATED('MD_NCM_FREEZE'[Freeze name])="201912" && RELATED('MD_TIME'[ALV_YEAR])="2019",'FACT_NCM_QFRZ'[MEASURE_ONE]) ),REMOVEFILTERS(MD_TIME[Reporting Month Number]))
Column: Reporting Month Number = if(MD_TIME[MONTH]="?",99, VALUE(RIGHT(MD_TIME[MONTH],2)))
IF(RELATED('MD_NCM_FREEZE'[Freeze name])="201912" && RELATED('MD_TIME'[ALV_YEAR])="2019",
I need to create a measure to calculate Baseline*Reporting month number
the target will be like :
I have tried this :
sumx(FACT_NCM_QFRZ,[Baseline]*related(MD_TIME[Reporting Month Number]))
but I'm not getting the correct results
Thank you in advance for your help,
Solved! Go to Solution.
Perfect, it's working. Thank you so much!
However I don't understand yet how the MAX has resolved it. If you can please clarify?
Thank you again!
@IlikePBI So, the MAX simply gets the maximum value of the column in context. So, each row in your table visual supplys a filter context for the Reporting Month Number. In the first row of the table visual the context is 1, second row 2, etc. So you could have also used MIN intead of MAX and if it is truly a numeric value you could technically use any of the basic aggregators, SUM, AVERAGE, etc. because the context of the row in the visual is filtering the column to a single value.
Click here to learn more about the September 2022 updates!
Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.
Watch Session 25 of Ted's Dev Camp.