Forum Discussion
Dax not working
Tooltip screen must capture mouse hovering value from main visual and show it .
how to write Dax for this.
Ex:
Tooltip must capture both the Ageing bucket (Above 6 months) and the Year (2022) from the main chart.
Then it should calculate and display %GT stock balance (Age) for that exact combination.
I see, the issue is not comming from the dax, but the kind of visual you are using
I converted my bar chart into a line charet, and now it is not working
It is related to how the tooltip is working with a line chart, the standard tooltip returns all values for a specific data, so here it doesn't understand what it has to return
The only workaround (I found), it is to use another visual
4 Replies
- Cookistador
Super User
Hi JothiG
Is it something like that you need to achieve ?
This is the dummy dataset I created
Above 6 months2023Above 6 months202310000
Ageing Stock_year Net_sales Less than 1 month 2022 10000 Less than 1 month 2023 5000 1-3 months 2022 5000 1-3 months 2023 30000 3-6 months 2022 15000 3-6 months 2023 10000 Above 6 months 2022 20000 Above 6 months 2023 40000 I called my table data and I created two measures
% GT Stock Balance (Age) =VAR Total =CALCULATE(SUM(Data[Net_sales]),ALL(Data[Ageing]))RETURNDIVIDE(SUM(data[Net_sales]),Total)%GT_stock_bal_age_Label =COALESCE(SELECTEDVALUE(Data[Ageing]), "No Age")& " , " &COALESCE(SELECTEDVALUE(Data[Stock_year]), "No Year")Then I created a new page, I set up as a tooltipI add the two measure on this page and in the bar chart, I select my page 2 as a tooltip
If it is not what you are trying to achieve, can you share some dummy data and a clear scenario?
- JothiG
Helper III
Net_sales Stock_year Stock_month Stock_month_name Fin_year Period Ageing 80788.38 2024 4 Apr 2024 Q1 Below 3 month 1405697.82 2024 4 Apr 2024 Q1 Below 3 month 280119033.52 2024 4 Apr 2024 Q1 Below 3 month 1433529.45 2024 4 Apr 2024 Q1 Below 3 month 76278.35 2024 4 Apr 2024 Q1 Below 3 month 51907.26 2024 4 Apr 2024 Q1 Below 3 month 44793496.19 2024 4 Apr 2024 Q1 Below 3 month 282460.05 2024 4 Apr 2024 Q1 Below 3 month 616680.59 2024 4 Apr 2024 Q1 Below 3 month 22809080.83 2024 4 Apr 2024 Q1 Below 3 month 389015.55 2024 5 May 2024 Q1 Below 3 month 218655.9 2024 5 May 2024 Q1 Below 3 month 628000.56 2024 5 May 2024 Q1 Below 3 month 296772145.52 2024 5 May 2024 Q1 Below 3 month 1440319.8 2024 5 May 2024 Q1 Below 3 month 4613.48 2024 5 May 2024 Q1 Below 3 month 7619.15 2024 5 May 2024 Q1 Below 3 month 60653491.87 2024 5 May 2024 Q1 Below 3 month 204911.05 2024 5 May 2024 Q1 Below 3 month 261303.5 2024 5 May 2024 Q1 Below 3 month - Cookistador
Super User
I see, the issue is not comming from the dax, but the kind of visual you are using
I converted my bar chart into a line charet, and now it is not working
It is related to how the tooltip is working with a line chart, the standard tooltip returns all values for a specific data, so here it doesn't understand what it has to return
The only workaround (I found), it is to use another visual