Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in BI by (11.1k points)

Here,I am defining in the middle of the DAX code

Expected Result =
SUMX (
    VALUES ( Unique_Manager[Manager] ),
    VAR SumBrand = CALCULATE ( SUM ( Budget_Brand[BudgetBrand] ) )
    VAR SumProduct = CALCULATE ( SUM ( Budget_Product[BudgetProduct] ) )
    RETURN
        IF ( ISBLANK ( SumProduct ), SumBrand, SumProduct )
)

where this measure works

Measure_good = CALCULATE( 
    SUM(table[Amount]) 

) 

and this doesnt works

Measure_bad = CALCULATE( 
    VAR inside_measure = SUM(table[Amount])
)

 What are the rules of VAR?

1 Answer

0 votes
by (22.5k points)

Use the following measure

Measure_bad = CALCULATE( 
    VAR inside_measure = SUM(table[Amount])
    RETURN
    inside_measure
)

Want to learn more about Power Bi, Refer & learn Power bi

Also, check out our YouTube video to know the data visualization basics and best practices with Power BI

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Mar 28, 2021 in BI by Chris (11.1k points)

Browse Categories

...