Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
User | Count |
---|---|
21 | |
19 | |
12 | |
10 | |
9 |
User | Count |
---|---|
30 | |
26 | |
15 | |
13 | |
10 |