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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
SDK0415
Frequent Visitor

Dynamic measure calculation based on filter selection

I would like to create a measure to have different calculations for different machines based on filter criteria, refer the screenshot from excel below. 

When I Select Machine b in Filter 1 & Mar Month in Filter 2 - the calculation should be 20(output)*23(No of working days in Mar month) = 460

When I Select Machine c in Filter 1 & Apr Month in Filter 2 - the calculation should be 30(output)*22(No of working days in Mar month)*120(Vol factor) = 75600

Coluymn A,B,C is the Data table

Column H&I is calendar table(I have a measure to calculate the no. of working days)

How can i achive it ?Capture.JPG

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @SDK0415 ,

Try to create a measure like below:

Measure = 
var select_month = MAX('Date'[work_days])
var select_machine = MAX('Table'[Output])
var vol_ = IF(ISBLANK(MAX('Table'[Vol Factors])),1,MAX('Table'[Vol Factors]))
return select_month*select_machine*vol_

Vlianlmsft_0-1643010467929.png

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @SDK0415 ,

Try to create a measure like below:

Measure = 
var select_month = MAX('Date'[work_days])
var select_machine = MAX('Table'[Output])
var vol_ = IF(ISBLANK(MAX('Table'[Vol Factors])),1,MAX('Table'[Vol Factors]))
return select_month*select_machine*vol_

Vlianlmsft_0-1643010467929.png

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Read about Calculation Groups and then decide if that's something you can implement with them.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.