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.
Hi
I am begginer with Power BI, and I need DAX formula for this. I have one table , in this table I have columns Lectures per year and Examples per year. I want to create new column where I wanna have SUM both columns per week. Thanks for answers.
You will need a date table. Add your date then add a calculated week number and year column to the date table. All dates must be included.
Then, in your sales table do two separate sums first (in case you need the separated next time)>
Total 1 = SUM('Sales Table'[First Column])
Total 2 = SUM('Sales Table'[Second Column])
Combined Total = [Total 1] + [Total 2]
This assumes the table is named 'Sales Table' and the columns you want to add are called [First Column] and [Second Column] for simplicity.
Then, using your date table and the sales table build the visualization by adding week number and combined total. You will probably want a year slicer as well if you have more than one years worth of data.
Or, you can cross over the year mark by adding a combined Year-Week to the date table by doing a simple calculated column such as Year-Week = [Year]&"-"&FORMAT([WeekNumber], "00") to get 2016-01, 2016-02, ect.
Of course this assumes that your sales table (or fact table) has a date assigned and not just a year. You really cannot easily break down the fact table by week unless there is a specific date assigned within the data.
Proud to be a Super User!
Hey you should create another table called "Calendar" that will include at least two columns - [Date] & [Week]. The dates need to be contiguous, meaning don't skip any dates - you can then join this Calendar table to the current table you have.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |