Forum Discussion
Dynamic Formatting Error
- 5 months ago
Hi tom-lenzmeier , I just modified the DAX formula you were using and obtained the following result. Can you let me know if this is what you are looking for?
The issue with the sum on the date was causing an overflow error, so I took the maximum value and added it to the date to resolve the problem.
Display Value Fixed = VAR _AttrType = SELECTEDVALUE(UP_PRD_Agreements[Attribute]) VAR _Raw = SUM(UP_PRD_Agreements[Value]) VAR _RawMax = MAX(UP_PRD_Agreements[Value]) RETURN SWITCH( _AttrType, "EffectiveDate", FORMAT( DATE(1899, 12, 30) + INT(_RawMax), "MM/dd/yyyy" ), "Current Price", FORMAT(_Raw, "$#,##0"), "Current Price Valid From", FORMAT( DATE(1899, 12, 30) + INT(_RawMax), "MM/dd/yyyy" ), FORMAT(_Raw, "0") )
dax :
Fixed dax :Sample file :
Dynamic Formatting.pbix
Thanks,
If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster
I am truly grateful for all of your assistance. I am hopefully only going to call upon you one more time. The slicer I am using, based on your earlier solution, is not behaving correctly. Right now regardless of whether I click on all attributes or changes only, nothing happens. If you recall, I'm hoping that when a user clicks on changes only, they see the non-current/current records and the unchanged ones are not displayed. Here's the data I'm working with. The date values have been converted to integers due to the dynamic formatting.
| Base Agreement Number | IsChanged | Attribute | Value | IsCurrent | Version |
| 00159957 | Changed | Current Price | 1100 | 1 | 1 |
| 00159957 | Changed | Current Price | 1300 | 0 | 1 |
| 00159957 | Changed | Current Price | 1300 | 1 | 2 |
| 00159957 | Changed | Current Price | 1430 | 1 | 2 |
| 00159957 | Changed | Effective Date | 46082 | 0 | 1 |
| 00159957 | Changed | Effective Date | 46082 | 1 | 1 |
| 00159957 | Changed | Effective Date | 46100 | 1 | 2 |
| 00161305 | Unchanged | Current Price | 745 | 1 | 1 |
| 00161305 | Unchanged | Effective Date | 46082 | 1 | 1 |
| 00162285 | Unchanged | Current Price | 57 | 1 | 1 |
| 00162285 | Unchanged | Current Price | 60 | 1 | 1 |
| 00162285 | Unchanged | Current Price | 175 | 1 | 1 |
| 00162285 | Unchanged | Effective Date | 46082 | 1 | 1 |
The dax measure is identical to yours.
Ok, when I drop DisplayValue in the matrix, it works. The measure I had been using (Display) didn't work in the slicer. Your code works, but your solution seems to be based on the measure and not the formatting? If I apply your code to the dynamic formatting, things go awry.