Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
JothiG
Helper II
Helper II

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.

%GT_stock_bal_age_Label =
COALESCE(SELECTEDVALUE(Stock_dtl[Ageing]), "No Age")
& " , " &
COALESCE(SELECTEDVALUE(Stock_dtl[Stock_year]), "No Year")
 
%GT_Stock Balance_Age =
DIVIDE(
    SUM(Stock_dtl[Net_sales]),
    CALCULATE(SUM(Stock_dtl[Net_sales]), ALL(Stock_dtl[Ageing]))
)  --These not working
1 ACCEPTED SOLUTION

I see, the issue is not comming from the dax, but the kind of visual you are using

Cookistador_0-1755758641264.png

 

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

View solution in original post

4 REPLIES 4
Cookistador
Super User
Super User

Hi @JothiG 

 

Is it something like that you need to achieve ?

Cookistador_0-1755754482299.png

 

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])
)
RETURN
DIVIDE(
    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 tooltip
Cookistador_1-1755754980788.png

 

I 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?

Net_salesStock_yearStock_monthStock_month_nameFin_yearPeriodAgeing
80788.3820244Apr2024Q1Below 3 month
1405697.8220244Apr2024Q1Below 3 month
280119033.5220244Apr2024Q1Below 3 month
1433529.4520244Apr2024Q1Below 3 month
76278.3520244Apr2024Q1Below 3 month
51907.2620244Apr2024Q1Below 3 month
44793496.1920244Apr2024Q1Below 3 month
282460.0520244Apr2024Q1Below 3 month
616680.5920244Apr2024Q1Below 3 month
22809080.8320244Apr2024Q1Below 3 month
389015.5520245May2024Q1Below 3 month
218655.920245May2024Q1Below 3 month
628000.5620245May2024Q1Below 3 month
296772145.5220245May2024Q1Below 3 month
1440319.820245May2024Q1Below 3 month
4613.4820245May2024Q1Below 3 month
7619.1520245May2024Q1Below 3 month
60653491.8720245May2024Q1Below 3 month
204911.0520245May2024Q1Below 3 month
261303.520245May2024Q1Below 3 month

 

JothiG_0-1755758217371.png

 

 

I see, the issue is not comming from the dax, but the kind of visual you are using

Cookistador_0-1755758641264.png

 

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

Hi  @JothiG  ,
Thanks for reaching out to the Microsoft fabric community forum.

 

I would also take a moment to thank @Cookistador   , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference. 
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.

Best Regards, 
Community Support Team 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors