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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
sivarajan21
Post Prodigy
Post Prodigy

Reference the field parameter in dax measures to dynamically change the visuals

Hi,

 

My requirement is to use columns from field parameter to dynamically change the visual
Field parameter table is as below:

sivarajan21_0-1706769859573.png

The columns Category, Category Main are calculated columns that are used in slicer buttons in visual.

sivarajan21_2-1706772282348.png

 

Now what I want to achieve is, when I click the Target button, and Units or cost I should have corresponding values dynamically selected in the below visual. Similarly when i select the Budget Cost/Units it should change the visual. 

sivarajan21_1-1706770057622.png

 

The line Y-axis of the above visual works perfectly as brought in the Parameter directly. But for column y-axis I have two things to be taken care of 
i)Actual

ii)Forecast

 

I had tried to tweak the forecast measure but its not dynamically changing the values, The forecast measure consist of 2 measures (preforecast & forecast)

Pre_forecast =
VAR _Totalunits = CALCULATE(SUMX(Target,Target[Value]),FILTER('Parameter 2','Parameter 2'[Type] = MAX('Parameter 2'[Type])))
VAR _noofdays = CALCULATE(
DATEDIFF(
    EOMONTH(MAX(Calendar_[Date]),-1),
    EOMONTH(MAX(Calendar_[Date]),0),
    DAY
    )
)
VAR _DailyUnits = DIVIDE(_Totalunits,_noofdays)
VAR _replaceblank = IF(
    ISBLANK([Actual Units]),
                _DailyUnits*_noofdays,IF([Actual Units] = 0,
                BLANK()))
RETURN _replaceblank
---------
Forecast Target Unit = IF (

    HASONEVALUE ( 'Calendar_'[Month] ),

    CALCULATE ( SUMX ( VALUES ( Points[DBName-Point_Id] ), [Pre_forecast_1] ) ),

    SUMX (

        VALUES ( 'Calendar_'[Month] ),

        CALCULATE ( SUMX ( VALUES ( Points[DBName-Point_Id] ), [Pre_forecast_1] ) )

    ))
Pre_forecast is the main measure that i am trying to reference the parameter.
 
Could you please help me to achieve this?
PFA file in link here Portfolio 6 latest.pbix

 

Thanks in advance!
@Ahmedx @amitchandak @Greg_Deckler @Ashish_Mathur @Anonymous @marcorusso 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sivarajan21 , I have made some changes in the file, check if those can help -https://www.dropbox.com/scl/fi/adaijt0nwzlg2t3nxizrz/Portfolio-6-latest.pbix?rlkey=uqkf4kfdeney8eu9ky4jdsgei...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@sivarajan21 , I have made some changes in the file, check if those can help -https://www.dropbox.com/scl/fi/adaijt0nwzlg2t3nxizrz/Portfolio-6-latest.pbix?rlkey=uqkf4kfdeney8eu9ky4jdsgei...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

Apologise for the delay!

Thanks for your quick and amazing solution!😊

This is working like a gem!

 

I will accept this as a solution and close this thread!

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors