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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
frankGB
Frequent Visitor

Create a dynamic measures using field parameter measure values

I am using field parameters for measures in Power BI. I use a simple paramter table as a sample. The actual paramter table has more than 100 metrics.

 

Referenced Measures used in the Field Paramter are:

Sales = SUM('Table-Sales'[Sales])

Units = SUM('Table-Units'[Units])

 

Measure-Parameter

frankGB_0-1672394057531.png

 

Let's use two simple tables for Sales and Units. Both Tables are connected to a 'Date-Table'.

 

Table-Sales

frankGB_1-1672394123722.png

Table-Units

frankGB_2-1672394210056.png

 

 

Based on the set-up above, this is what I would like to accomplish using the parameters. 

Calculated Measure  = CALCULATE(SUM('Measure-Parameter'[Metric Fields]), 'Date-Table' =  Date(2022,01,01)

 

The expected visual output of this simple example using the Metric column from the parameter table would then be:

 

frankGB_3-1672394291149.png

 

This formular obviously doesn't work because SUM requires a value column as a reference.  

Buit how could this work? "Metrics Field" column value would be exactly the syntax that would be needed for the calculated measure but yes, it would have to be provided as a variable in the SUM function.  

 

I don't want to use a Switch Function because it would require to incldue every single measure used in the parameter to be listed there. With over 100 parameter measures this will not scale and be very difficult to maintain moving forward.  

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@frankGB , Not very clear. One it simple Switch values on Row in Matrix Visual

 

https://www.youtube.com/watch?v=M5PvQUy-L_4

 

If not then you need to use the calculation group

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display: https://youtu.be/qMNv67P8Go0

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

3 REPLIES 3
amitchandak
Super User
Super User

@frankGB , Not very clear. One it simple Switch values on Row in Matrix Visual

 

https://www.youtube.com/watch?v=M5PvQUy-L_4

 

If not then you need to use the calculation group

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display: https://youtu.be/qMNv67P8Go0

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

The calculation groups seem to work. The video is quite useful. 

Thank you for pointing me to this solution.

Thank you Amit,

the Matrix visual works if you don't use any calculations. But because in the example I need a filtered calculation using the calculated measure, it will not work when the calculation becomes more complex. 

 

If I for exaple want to calculate a change percentage, I will need a calculated measure like below.

 

Calculated Measure  = CALCULATE(SUM('Measure-Parameter'[Metric Fields]), 'Date-Table' =  Date(2022,01,01) / 

CALCULATE(SUM('Measure-Parameter'[Metric Fields]), 'Date-Table' =  Date(2022,01,02)

 

I had a quick look at the Calculation Group. This might be a feasible solution actually. Let me try this. It seems using Calculation Groups and using dynamic period calculation groups, would remove the need to the field paramters anyway. 

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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