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.
While creating a column to use as a conditional formating field, I have encountered an issue we cannot explain.
I backed off the conditional set when I was verifying my VAR steps to just look at the date conversion. (We ultimately want a date to show a red background in a visual when a contract is within 3 months of expiring.)
The DAX is simply:
Solved! Go to Solution.
I created a small sample of dates to try an re-create the issue. And I was successful in getting some blanks and some correct values. I changed the endminus3 measure to return the date 12/31/9999 when blank to troubleshoot if it was a "blanks" issue or a date issue. The blanks were not the problem, so it is something with the dates. I looked at the dateadd function documentation and found
The result table includes only dates that exist in the dates column.
That describe what I was seeing in my small data set. I wonder if it applies to your situation.
To get around this I added a column in Power Query to do the math there and it works just fine.
= Table.AddColumn(#"PreviousStep", "endminus3", each Date.AddMonths([Date], -3))
is what I added in Power Query
Proud to be a Super User! | |
I created a small sample of dates to try an re-create the issue. And I was successful in getting some blanks and some correct values. I changed the endminus3 measure to return the date 12/31/9999 when blank to troubleshoot if it was a "blanks" issue or a date issue. The blanks were not the problem, so it is something with the dates. I looked at the dateadd function documentation and found
The result table includes only dates that exist in the dates column.
That describe what I was seeing in my small data set. I wonder if it applies to your situation.
To get around this I added a column in Power Query to do the math there and it works just fine.
= Table.AddColumn(#"PreviousStep", "endminus3", each Date.AddMonths([Date], -3))
is what I added in Power Query
Proud to be a Super User! | |
You hit it spot on!
That was the limiting issue. I need to remember that one for the future.
Kudos and Solution Acceptance given.
Thanks again,
Trent
Thanks for taking a look. Since it has the reference date in the 'Contract End' column, I would not think it an issue. I will go back and see if that is indeed the case.
I do have a date table which does NOT have a direct relationship to this table but is linked through another table. I had tried creating an inactive direct relationship and adding USERELATIONSHIP to the DAX but it did not seem to make any difference.
I will update on the finding from your suggestion.
Trent
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 |
---|---|
131 | |
80 | |
53 | |
38 | |
35 |
User | Count |
---|---|
207 | |
82 | |
75 | |
55 | |
50 |