Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone,
It works fine, if no attributes or dimensions are used, the metric gets the number of people from the last date of fact_date:
Total Person (Last fact_date)
it corresponds to the code:
The problem comes when entering another field, in this case the end of contract date (end_contract_date), which I have converted to string on source database to avoid other problems.
In this case, the metric doesn't work and when the fact_date date is not used, it gets values previous to the last fact_date date.
Values out of date_fact from Total_Person metric
This behavior is not valid. The metric should exclude data for end_contrac_date values '19991231' that corresponds to a date before (2019-11-30), only should gets data for the last date of fact_date (2019-12-31).
Could someone help me to solve the error? I have used this type of metric on various tables and they work correctly except from this metric. The HHRR table is not related to any table and is not a model problem.
I don't exactly yet understand the issue... but I can tell you that your model is not a good one. Please watch these to see how to create good, reliable and correct models:
Bear in mind that if you don't follow the Best Practices you'll be having bugs in your calculations without even realizing this. This is not a joke. Please read this to see what issues you can face:
https://www.sqlbi.com/articles/understanding-dax-auto-exist/
Also, please note that each and every sound, good model needs to have a DATE TABLE and slicing by columns of a fact table is strictly forbidden. Slicing can be only carried out through dimensions. You should have all columns in your fact tables HIDDEN.
Best
D
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
20 | |
14 | |
10 | |
9 | |
6 |