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.
I have a table with a month register for each employee I have a measure that calculates the last month I have registered
CalculatedLastMonth = CALCULATE(MAX(T_Staff_SAP[Month]))
This works well, in a Matrix table I have it show for example
2016 2017 2018 2019
Last Month 12 12 12 1
Then I have a formula that calculates the HQ for the latest month of that year:
CalculatedHQKLastMonth = CALCULATE(DISTINCTCOUNT(T_Staff_SAP[ID]),FILTER(T_Staff_SAP,T_Staff_SAP[Month]=[CalculatedLastMonth]))
And i get this:
2016 2017 2018 2019
HQ 124 113 109 100
But if I put 12 as Calculated last Month on the Measure I get:
2016 2017 2018 2019
HQ 100 99 98 0
Is like CalculatedLastMonth is getting the current month for each time it calculates the month, so I'm getting the distinct count for the whole year instead of just the last month, but I put 12 by hand I'm missing the results for the latest year.
Solved! Go to Solution.
@Anonymous ,
You may use Variables in DAX.
@Anonymous ,
You may use Variables in DAX.
Thanks, that worked like a charm
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |