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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.