Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Here is my measure:
Absorptions Per Month = ROUND(SUM('Data by Bedrooms'[Bedroom Sales])/6,0)
Solved! Go to Solution.
If you have a Dates table, it would be something along the lines of:
Absorptions Per Month = CALCULATE ( ROUND ( SUM ( 'Data by Bedrooms'[Bedroom Sales] ) / 6, 0 ), FILTER ( Dates, Dates[Month] = 12 ), FILTER ( Dates, Dates[Year] = 2018 ) )
Assuming your Dates table is Dates, and you have a Month and Year column in it.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingIf you have a Dates table, it would be something along the lines of:
Absorptions Per Month = CALCULATE ( ROUND ( SUM ( 'Data by Bedrooms'[Bedroom Sales] ) / 6, 0 ), FILTER ( Dates, Dates[Month] = 12 ), FILTER ( Dates, Dates[Year] = 2018 ) )
Assuming your Dates table is Dates, and you have a Month and Year column in it.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting@edhans, I don't have a date table. Is there another way to do this? Or is creating a dates table the best option?
It is the best option.
You can try to do it using the built in dates table when you don't create one, but the syntax gets tedious. It would begin to look something like this:
Test = CALCULATE( SUM(Sales[Sales]), FILTER(Sales,[Date].[MonthNo]=1) )
But if your Power BI model has dates, create a date table. Just make it a habit. You'll never build a model with a date table and wish you hadn't. You'll often build a model without a date table and wish you had done so from the start.
This article will help you quickly build a dynamic Date table for your model.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThanks, appreciate it.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |