Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Everyone,
Here is a simplified version of my table called 'Employee Performance'
Employee | Location | Shift | Task Type | Task Value | Work Volume | Report Date |
John Doe | Office | First Rotation | AB | 0.75 | 1 | 10/10/2021 |
Jane Doe | Home | Second Rotation | AB | 1 | 2 | 10/10/2021 |
Batman | Bat Cave | Third Rotation | CD | 0.25 | 1 | 10/10/2021 |
John Doe | Office | First Rotation | CD | 0.75 | 2 | 10/10/2021 |
Batman | Bat Cave | Third Rotation | EF | 0.25 | 3 | 10/10/2021 |
John Doe | Home | Third Rotation | AB | 0.75 | 1 | 10/11/2021 |
Jane Doe | Bat Cave | First Rotation | AB | 1.5 | 2 | 10/11/2021 |
Batman | Office | Second Rotation | CD | 0.5 | 6 | 10/11/2021 |
John Doe | Home | Third Rotation | EF | 0.75 | 1 | 10/11/2021 |
John Doe | Bat Cave | First Rotation | CD | 0.75 | 2 | 10/12/2021 |
Jane Doe | Office | Third Rotation | EF | 0.75 | 3 | 10/12/2021 |
Batman | Home | Second Rotation | AB | 1 | 4 | 10/12/2021 |
John Doe | Bat Cave | First Rotation | AB | 0.75 | 2 | 10/12/2021 |
John Doe | Office | First Rotation | CD | 1.5 | 3 | 10/13/2021 |
Jane Doe | Home | Third Rotation | EF | 0.5 | 1 | 10/13/2021 |
Batman | Bat Cave | Second Rotation | AB | 0.25 | 4 | 10/13/2021 |
Jane Doe | Home | Third Rotation | CD | 0.25 | 2 | 10/13/2021 |
Batman | Bat Cave | Second Rotation | US | 0.75 | 1 | 10/13/2021 |
Ned Flanders | Home | Third Rotation | US | 0.33 | 2 | 10/14/2021 |
Bart Simpson | Office | First Rotation | AB | 1 | 3 | 10/14/2021 |
John Doe | Home | Third Rotation | EF | 1 | 1 | 10/15/2021 |
Jane Doe | Bat Cave | Second Rotation | CD | 0.25 | 2 | 10/15/2021 |
Batman | Office | First Rotation | CD | 0.5 | 1 | 10/15/2021 |
John Doe | Home | Second Rotation | AB | 0.5 | 1 | 10/16/2021 |
John Doe | Bat Cave | First Rotation | EF | 0.25 | 4 | 10/17/2021 |
Batman | Office | Third Rotation | AB | 0.75 | 2 | 10/17/2021 |
John Doe | Bat Cave | Second Rotation | CD | 0.75 | 6 | 10/17/2021 |
Jane Doe | Office | First Rotation | AB | 0.25 | 1 | 10/17/2021 |
Batman | Home | Third Rotation | EF | 0.75 | 1 | 10/17/2021 |
Jane Doe | Office | Third Rotation | US | 0.75 | 2 | 10/18/2021 |
Batman | Home | Second Rotation | CD | 0.33 | 2 | 10/18/2021 |
John Doe | Office | First Rotation | AB | 1 | 1 | 10/18/2021 |
I'm trying to return the total work volume for the last 3 days by location.
Here's the DAX I have:
Solved! Go to Solution.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
That worked splendidly! One last question though, I noticed that the page filter will still effect the measure if the number of days passed is less than 3. Any idea how to make it ignore that?
Hi @mccollough
Currently, your measure looks to be returning the number of rows (i.e. 27).
Can you give the following a go (adjust Table Names to your relevant table name... I called mine tblBatMan :D) I've also added the "ALL ('tblBatman')" at the end to ignore filters 🙂
mea_New =
VAR _StartDate = LASTDATE ( 'tblBatMan'[Report Date] )
VAR _EndDate = MAX ( tblBatMan[Report Date] ) - 2
RETURN
CALCULATE ( SUM ( tblBatMan[Work Volume] ) , FILTER ( 'tblBatMan' , _StartDate <= MAX ( 'tblBatMan'[Report Date] ) && 'tblBatMan'[Report Date] >= _EndDate ) , FILTER ('tblBatMan' , tblBatMan[Location] = "Bat Cave" ) , ALL ('tblBatman') )
You should get 10 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |