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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

forcing evaluation of DAX measures

In summary, the question is it possible to force the evualation of a dax measure and is it possible to ignore row context of table visual?

 

Scenario:

In my powerbi report, I have bunch of slicers, let's call them: slicer_1, slicer_2, slicer_3. Using the filter context of these slicers, I have a measure which returns a single value. The measure is as follows:

 

min_version = 
// calculate percentage errors for the version with minimum absolute percentage error

var tble = SUMMARIZE (
        'Volume Analysis',
        [slicer_1],
        [slicer_2],
        [slicer_3],
        [slicer_4]
    ,
    "avg_error",
        ABS (
            DIVIDE (
               SUM([Cumulative Actuals]) - sum([Cumulative Forecast]),
               SUM([Cumulative Actuals]),
                BLANK ()
            ) * 100
        )
)

var version_selected = MAXX(TOPN(1, tble, [avg_error], ASC), [slicer_1])

return
version_selected

 

 

Now, I want to use the output of above measure to use as a filter condition for my tabular view and want to use it as a constant and not change it according to the row context of table. For example, if my table is as follows:

RegionCountryBrandCalculated Value
AsiaChinab1v1
AsiaChinab2v2
AsiaChinab3v3
AsiaChinab4v4

 

And my measure is as follows:

 

error = 
CALCULATE(
    ABS(
        DIVIDE(
            SUM('Volume Analysis'[Cumulative Actuals]) - SUM('Volume Analysis'[Cumulative Forecast]),
            SUM('Volume Analysis'[Cumulative Actuals]),
            BLANK()
        )*100
    ),
    
    'Volume Analysis'[version] = [version_selected]
)

 

 

I wish to calculate the column "Calculated Value" by ignoring the "brand_name" column's effect but taking into account "Region" and "Country" column name. Essentially return the same value irrespective of brand name. 

1 REPLY 1
lbendlin
Super User
Super User

keep in mind that measures cannot influence columns. Have you considered using REMOVEFILTERS() or ALLEXCEPT() ?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors