Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have a table that is pulling data from an excel work book. This table is then appended to combine with a table that is coming from a SQL query. I am trying to filter the dates on the excel table to match the results from the SQL query.
The excel data looks like this:
Date | Machine | Time | Job |
4/9/2022 | Alpha | 4 | 1098 |
8/23/2022 | Beta | 3.5 | 1702 |
8/23/2022 | Beta | 2 | 1701 |
9/30/2022 | Delta | 4.5 | 1104 |
10/01/2022 | Alpha | 3 | 1093 |
Right now I have this DAX:
SUMMARIZEMachine =
CALCULATETABLE(
SUMMARIZE(
'MachineRunTime'
,MachineRunTime[Date]
,MachineRunTime[Machine]
,MachineRunTime[Time]
,MachineRunTime[Job]
)
,FILTER(ALL(
MachineRunTime
), FORMAT(MachineRunTime[Date], "Short Date") >= FORMAT(DATEADD(MachineRunTime[Today], -84, DAY), "Short Date"))
)
That creates a table for me, but it doesn't acutally filter the Date column and it shows all the data. How can I fix this so the Date column is filtered correctly? Note that I created a "Today" column in the original table within Power BI so I could use the DATEADD() function.
Solved! Go to Solution.
I realized that I don't need the DATEADD function to get the results I need. Coming from a SQL background, I mistakenly thought that might be needed.
Solution was as follows:
SUMMARIZEMachine =
CALCULATETABLE(
SUMMARIZE(
'MachineRunTime'
,MachineRunTime[Date]
,MachineRunTime[Machine]
,MachineRunTime[Time]
,MachineRunTime[Job]
)
,FILTER(
ALL(SecureMachineRunTime)
,MachineRunTime[Date] >= TODAY() - 42
)
)
I realized that I don't need the DATEADD function to get the results I need. Coming from a SQL background, I mistakenly thought that might be needed.
Solution was as follows:
SUMMARIZEMachine =
CALCULATETABLE(
SUMMARIZE(
'MachineRunTime'
,MachineRunTime[Date]
,MachineRunTime[Machine]
,MachineRunTime[Time]
,MachineRunTime[Job]
)
,FILTER(
ALL(SecureMachineRunTime)
,MachineRunTime[Date] >= TODAY() - 42
)
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |