Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I want to convert below Excel fomulas to DAX. i have mentioned Excel column headers and AM & PM model static values,
PM MODEL:
CV -- FACTOR EXCEL COLUMN
how to convert this formula to dax for time based withAM and PM static value ? looking for support .. thanks in advance
To convert the Excel formula to a DAX formula, you can use the following approach in Power BI or other tools that support DAX:
TimeTable = CALENDAR(TIME(0, 1, 0), TIME(23, 59, 0), 15)
Calculate the Factor for AM and PM models based on the time:
FactorAM =
SUMX(
TimeTable,
SWITCH(
TRUE(),
TimeTable[Time] < TIME(0, 1, 0), 0,
TimeTable[Time] < TIME(6, 0, 0),
TimeTable[Time] * VALUES('AM Model'[Factor]),
TimeTable[Time] >= TIME(6, 0, 0), VALUES('AM Model'[Factor])
)
)
FactorPM =
SUMX(
TimeTable,
SWITCH(
TRUE(),
TimeTable[Time] < TIME(9, 0, 0), 0,
TimeTable[Time] >= TIME(9, 0, 0), VALUES('PM Model'[Factor])
)
)
Note: Replace 'AM Model' and 'PM Model' with the actual names of your tables containing AM and PM model factors.
Output =
SUMX(
TimeTable,
TimeTable[FactorAM] * [T1] +
TimeTable[FactorPM] * [T1]
)
In this example, I assumed that your input table has a column named 'T1' containing the values for each time. Adjust the column and table names as needed based on your actual data structure.
This DAX formula should give you the output based on the factors and time values for both the AM and PM models.
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
9 |