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 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.
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 |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |