Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I need help with the calculation in Dax:
Below is the graph I need and the line is giving the correct results. The number "850" is the total for January and I need to put in a formula to calculate month 1 instead. So the formula will work when I select a different year. Thanks.
Solved! Go to Solution.
Hi Lucy64,
What is your current situation?
To use measure to help calculate the first month value of each year, we need add filter in the measure.
In addition to the month value, we also need to filter the year within Measure.
Follow the steps below:
Datetable = CALENDAR(min(Sheet1[Date]),max(Sheet1[Date]))
Year = year('Datetable'[Date])
yearC = IF( HASONEVALUE( 'Datetable'[Year] ), CALCULATE( VALUES( 'Datetable'[Year])))
FirstmonthValue = calculate([CalTotalIOT], filter(ALLSELECTED(Sheet1),and(month(Sheet1[Date])=1, year(Sheet1[Date])=[yearC])))
Precent = ([Month1sales2]-[Measure])/[Month1sales2]
Post back if any further assistance needed.
Regards
Hi Lucy64,
What is your current situation?
To use measure to help calculate the first month value of each year, we need add filter in the measure.
In addition to the month value, we also need to filter the year within Measure.
Follow the steps below:
Datetable = CALENDAR(min(Sheet1[Date]),max(Sheet1[Date]))
Year = year('Datetable'[Date])
yearC = IF( HASONEVALUE( 'Datetable'[Year] ), CALCULATE( VALUES( 'Datetable'[Year])))
FirstmonthValue = calculate([CalTotalIOT], filter(ALLSELECTED(Sheet1),and(month(Sheet1[Date])=1, year(Sheet1[Date])=[yearC])))
Precent = ([Month1sales2]-[Measure])/[Month1sales2]
Post back if any further assistance needed.
Regards
Michael, thank you very much. I followed your instructions and it works perfect! I really love power BI just wish I could get my head around the DAX language. I need to look for an online course or some good books to read.
Thanks again.
In general, something like:
MyMeasure = CALCULATE([CalTotalIOT],[Month] = 1)
User | Count |
---|---|
92 | |
77 | |
71 | |
64 | |
58 |
User | Count |
---|---|
106 | |
97 | |
76 | |
63 | |
61 |