Forum Discussion
Dynamically show missing values in a line graph with max date value of particular fields
Hi Team,
| Category | Date | NAV | Equity |
| ABC | 9/10/2024 | 250 | |
| ABC | 9/9/2024 | 201 | |
| ABC | 9/6/2024 | 152 | |
| ABC | 9/5/2024 | 103 | |
| ABC | 9/4/2024 | 54 | |
| ABC | 9/3/2024 | 20 | |
| ABC | 9/2/2024 | 40 | |
| ABC | 5/15/2024 | 280 | 300 |
| ABC | 4/25/2024 | 208 | 201 |
| ABC | 1/20/2024 | 201 | 207 |
| XYZ | 9/10/2024 | 230 | 250 |
| XYZ | 9/9/2024 | 201 | |
| XYZ | 9/6/2024 | 152 | |
| XYZ | 9/5/2024 | 103 | |
| XYZ | 9/4/2024 | 154 | |
| XYZ | 9/3/2024 | 120 | |
| XYZ | 9/2/2024 | 140 | |
| XYZ | 5/10/2024 | 290 | 300 |
| XYZ | 4/10/2024 | 208 | 201 |
| XYZ | 1/20/2024 | 240 | 207 |
there are two slicer
Slicer1-Category Slicer
Slicer2- another is name column that i created as a table with that unique fields to use in the slicer like Equity,Nav ..Etc...
Grapgh- line chart
x-axis- Date
Y-axis- Line graph Selected Measure Name
legend- Name
Measure-
Line graph Selected Measure Name=
VAR MySelection =
SELECTEDVALUE ( NameTable(Name))
RETURN
SWITCH (
TRUE (),
MySelection = "NAV", SUM(sourceTable[NAV]])/100,
MySelection = "Equity", SUM(sourceTable[Equity])/100,
SUM(sourceTable[NAV] )
but the problem is we have some missing data in some of the fields
like we have all the data in the NAV column with all dates
but in the other fields like Equity column we have limited data
Our objective is to make a consistant line, it means that whatever the max date of equity and the value that should display with rest of other dates values till our NAV max date so lets consider 5/15/2024 is the max date and value is 300 once we select ABC from the slicer then our line graph it should show 300 value from 5/15/2024 to 9/10/2024 date
Thanks
2 Replies
- AnonymousNot applicable
Hi anshenterprice ,
Try to modify your formula and create slicer table with not relationship like below:
Result = VAR MySelection = SELECTEDVALUE ( NameTable[Name] ) VAR MaxEquityDate = CALCULATE ( MAX ( sourceTable[Date] ), NOT ( ISBLANK ( sourceTable[Equity] ) ) ) VAR MaxEquityValue = CALCULATE ( SUM ( sourceTable[Equity] ), sourceTable[Date] = MaxEquityDate ) RETURN SWITCH ( TRUE (), MySelection = "NAV", SUM ( sourceTable[NAV] ) / 100, MySelection = "Equity", IF ( ISBLANK ( SUM ( sourceTable[Equity] ) ), MaxEquityValue / 100, SUM ( sourceTable[Equity] ) / 100 ), SUM ( sourceTable[NAV] ) / 100 )Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- anshenterpriceHelper I
Anonymous
Still its not working, Can you please select two equity and nav also from the slicer