Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to create table like this. How will we be able to achieve this using DAX?
Name | dollar | Weeks | dollars/week |
Holiday Weeks | $5 | 5 | 12.34 |
Non-Holiday Weeks | $4.9 | 5 | 12.34 |
Hi, @JenniferWallace
you want it from manual data entry or based on another table?
if it based on manual entry then try @FreemanZ solution
if based on another table then try below
newtable =
addcolumn(
all(tablename[holidayweekcolumn]),
"dollar" ,calculate(sum(tablename[dollarcolumn])),
"weeks",weeknum(tablename[datecolumn],2),
"dollar/week",calculate(sum(tablename[dollar/weekcolumn]))
)
if it not work then ellaborate your problem
can you tell us what kind of column and table you have in your data
hi @JenniferWallace ,
do you mean a calculated table like:
table =
DATATABLE (
"Name",STRING,
"dollar", CURRENCY,
"Weeks", INTEGER,
"dollars/week", DOUBLE,
{
{ "Holiday Weeks", 5, 5, 12.34},
{ "Non-Holiday Weeks", 4.9, 5, 12.34}
}
)
it worked like:
To create a table like the one you've described using DAX (Data Analysis Expressions), you can use DAX measures in Power BI or other similar tools. Assuming you have a table in your data model that contains information about different types of weeks (e.g., "Holiday Weeks" and "Non-Holiday Weeks"), you can follow these steps:
Create a New Table: Create a new table in Power BI or your data modeling tool where you can define the structure of your table. You can use the following DAX formula to create a new table:
SummaryTable = VALUES('YourWeeksTable'[WeekType])
Replace 'YourWeeksTable' with the actual name of your table containing information about different weeks.
Define DAX Measures: Define the following DAX measures to calculate the desired values:
TotalDollars = SUM('YourWeeksTable'[Dollar])
TotalWeeks = SUM('YourWeeksTable'[Weeks])
DollarsPerWeek = DIVIDE([TotalDollars], [TotalWeeks], 0)
To create a table like the one you've described using DAX (Data Analysis Expressions), you can use DAX measures in Power BI or other similar tools. Assuming you have a table in your data model that contains information about different types of weeks (e.g., "Holiday Weeks" and "Non-Holiday Weeks"), you can follow these steps:
Create a New Table: Create a new table in Power BI or your data modeling tool where you can define the structure of your table. You can use the following DAX formula to create a new table:
Replace 'YourWeeksTable' with the actual name of your table containing information about different weeks.
Define DAX Measures: Define the following DAX measures to calculate the desired values:
Adjust the column and table names based on your actual data model.
Build the Table: Now, you can use these measures in your new table. Assuming you have a column named WeekType in your SummaryTable, add the following columns:
Name = 'SummaryTable'[WeekType]
Dollar = CALCULATE([TotalDollars], FILTER('YourWeeksTable', 'YourWeeksTable'[WeekType] = 'SummaryTable'[WeekType]))
Weeks = CALCULATE([TotalWeeks], FILTER('YourWeeksTable', 'YourWeeksTable'[WeekType] = 'SummaryTable'[WeekType]))
DollarsPerWeek = CALCULATE([DollarsPerWeek], FILTER('YourWeeksTable', 'YourWeeksTable'[WeekType] = 'SummaryTable'[WeekType]))
These columns will retrieve the necessary values for each week type.
Remember to replace 'YourWeeksTable' with the actual name of your table containing the week information.
This way, you will have a table with the desired structure, showing the total dollars, total weeks, and dollars per week for each week type.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |