Forum Discussion
Taget table distorting the visual
- Anonymous1 year ago
Hi Marico
Thanks for the reply from rajendraongole1 and Ashish_Mathur.
If I understand correctly, your requirement is to show the bars and target line for the previous six months and and the target line for the next six months in the visualization object based on the value of the slicer? Then displays colors based on different conditions, but I need to check with you, do you need to change the color of the bar or the line? Based on my testing, I'm afraid that if you need to change the color of the line based on different conditions, it's not possible now.
Please refer to the following test.
1. Create a calculated table as the slicer
Slicer = VALUES('Date'[Month-Year])2. Create two measures as follow
Measure = VAR _selected = SELECTEDVALUE(Slicer[Month-Year]) VAR _pre6 = EOMONTH(_selected, -7) + 1 VAR _next6 = EOMONTH(_selected, 6) RETURN IF(MAX('Date'[Date]) >= _pre6 && MAX('Date'[Date]) <= _next6, 1, 0)formatting = SWITCH(TRUE(), [% op] > [fully op %], "green", [% op] = [fully op %], "blue", [% op] < [fully op %], "red")3. Put the measure into the visual-level filters, set up show items when the value is 1.
As I understand it, this needs to show up to 2025/7. I have looked at your raw data and since the raw data only has data up to 2025/6, it is not possible to show data up to July on this side. If new data is added in the future, then it should show up to July.
The following is about the color setting.
Output:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous1 year ago
Hi Marico
Based on testing, since your x-axis uses the month-year column in the Date table, and since there is a relationship between the Date table and the other tables, filtering will only filter out the data that corresponds to the option, so we need a separate table. Otherwise it would look like the following:
You can create a calculated column in the Slicer table.
Column = IF(YEAR('Slicer'[Month-Year]) = YEAR(TODAY()) && MONTH('Slicer'[Month-Year]) = MONTH(TODAY()), "Current", FORMAT('Slicer'[Month-Year], "YYYY-MMM"))The column is then used as a field for slicer.
Then modify the measure to the following:
Measure = VAR _selected = CALCULATE(MAX('Slicer'[Month-Year]), FILTER('Slicer', [Column] = SELECTEDVALUE('Slicer'[Column]))) VAR _pre6 = EOMONTH(_selected, -7) + 1 VAR _next6 = EOMONTH(_selected, 6) RETURN IF(MAX('Date'[Date]) >= _pre6 && MAX('Date'[Date]) <= _next6, 1, 0)Output:
You need to check the current month option once, and then when you open the file in the future, the current month option will be checked by default.
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 1 year ago
Hi Anonymous Based on my analysis, column EndOfMonth = EOMONTH('Date'[Date], 0)
wasn't giving the correct values for the bar, as I want op % on the last day of the month.
So, I created following two columns in the date table to fulfill the requirement.
endofmonth =
VAR maxsalesdate = ENDOFMONTH(sales[date])
VAR lastdateofmonth = ENDOFMONTH(Date_Table[Date])
VAR MaxSalesDateOfMonth = MIN(maxsalesdate, lastdateofmonth)
RETURN
IF (
Date_Table[Date] = MaxSalesDateOfMonth, Date_Table[Date], BLANK()
)
End of Month = IF
(
Date_Table[endofmonth] <> BLANK(), Date_Table[endofmonth],
if(
Date_Table[Date]> max(sales[date]) && MONTH(MAX(sales[date])) <> MONTH(Date_Table[Date]),
ENDOFMONTH(Date_Table[Date]),
BLANK()
)
)
Hi,
There is no file there. Share the link again with the relationship corection that you have made. If possible, show the expected result (in a Table format).
Hi Ashish_Mathur - Please check now, you should see the file in the link. I uploaded the file with corrected relationship there.
1. In the default view, 12 month period centered on current month
i.e. we need to populate bar chart values for previous 6 months and empty bar chart values for next 6 months, even though target line should still appear for empty bar values
When Jan 2025 starts, then the bars and target line should be for months 2024-07, 2024-08, 2024-09, 2024-10, 2024-11, 2024-12, 2025-01, and the next 6 months no bars, just target line. This should change dynamically for all months going forward.
2. Color coding: if target line is above bar then red, if target is below bar then green and if target and bar on same line then blue.
Let me know if I need to share more details around the requirement.
- Ashish_Mathur1 year agoSuper User
Hi,
Could you check the attached file.
Hope this helps.
- Marico1 year agoHelper IV
Ashish_Mathur rajendraongole1 Sorry, solution in attached file is not as per the rquirement.
Screenshot from file shared in last message by Ashish:
In the default view, 12 month period centered on current month
i.e. we need to populate bar chart values for previous 6 months and empty bar chart values for next 6 months, even though target line should still appear for empty bar values
When Jan 2025 starts, the bars and target line should be for months 2024-07, 2024-08, 2024-09, 2024-10, 2024-11, 2024-12, and 2025-01. For the next six months, there will be no bars, just a target line. This should change dynamically for all months going forward.
- Anonymous1 year agoNot applicable
Hi Marico
Thanks for the reply from rajendraongole1 and Ashish_Mathur.
If I understand correctly, your requirement is to show the bars and target line for the previous six months and and the target line for the next six months in the visualization object based on the value of the slicer? Then displays colors based on different conditions, but I need to check with you, do you need to change the color of the bar or the line? Based on my testing, I'm afraid that if you need to change the color of the line based on different conditions, it's not possible now.
Please refer to the following test.
1. Create a calculated table as the slicer
Slicer = VALUES('Date'[Month-Year])2. Create two measures as follow
Measure = VAR _selected = SELECTEDVALUE(Slicer[Month-Year]) VAR _pre6 = EOMONTH(_selected, -7) + 1 VAR _next6 = EOMONTH(_selected, 6) RETURN IF(MAX('Date'[Date]) >= _pre6 && MAX('Date'[Date]) <= _next6, 1, 0)formatting = SWITCH(TRUE(), [% op] > [fully op %], "green", [% op] = [fully op %], "blue", [% op] < [fully op %], "red")3. Put the measure into the visual-level filters, set up show items when the value is 1.
As I understand it, this needs to show up to 2025/7. I have looked at your raw data and since the raw data only has data up to 2025/6, it is not possible to show data up to July on this side. If new data is added in the future, then it should show up to July.
The following is about the color setting.
Output:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.