Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello everyone
I am trying to create a one-size-fits-all measure for multiple tables, but I got stuck somewhere.
Below is a dummy case:
Raw Data
| Year | Store | Product | Location | Revenue |
| 1/1/2019 | A | Ice Cream | New York | $ 500 |
| 1/1/2019 | A | Beer | New York | $ 500 |
| 1/1/2019 | B | Ice Cream | Little Rock | $ 100 |
| 1/1/2019 | B | Beer | Little Rock | $ 500 |
| 1/1/2019 | B | Chips | Little Rock | $ 450 |
| 1/1/2019 | C | Ice Cream | Denver | $ 300 |
| 1/1/2019 | C | Beer | Denver | $ 600 |
| 1/1/2019 | C | Pizza | Denver | $ 1,000 |
| 1/1/2019 | C | Chips | Denver | $ 200 |
| 1/1/2020 | A | Ice Cream | New York | $ 350 |
| 1/1/2020 | A | Beer | New York | $ 450 |
| 1/1/2020 | A | Chips | New York | $ 1,000 |
| 1/1/2020 | B | Ice Cream | Little Rock | $ 200 |
| 1/1/2020 | B | Beer | Little Rock | $ 500 |
| 1/1/2020 | B | Pizza | Little Rock | $ 450 |
| 1/1/2020 | B | Chips | Little Rock | $ 350 |
| 1/1/2020 | C | Beer | Denver | $ 200 |
| 1/1/2020 | C | Chips | Denver | $ 100 |
To get the difference/ change between the revenue mix of 2019 and 2020, I created a measure "Diff_Mix_btw_Years_Store"
Diff_Mix_btw_Years_Store =
var _current_mix_ = DIVIDE(SUM(Store[Revenue]),CALCULATE(SUM(Store[Revenue]),ALL(Store[Store])))
var _previous_mix_ = DIVIDE(CALCULATE(SUM(Store[Revenue]),DATEADD(Store[Year].[Date],-1,YEAR)),CALCULATE(SUM(Store[Revenue]),DATEADD(Store[Year].[Date],-1,YEAR),ALL(Store[Store])))
return
CONCATENATE(FIXED((_current_mix_ - _previous_mix_)*100,1)," pts")
I returned what I need (B-A)
However, if I want to get the B-A value after replacing the row filter with either "product" or "location", I will have to create new measures and replace the Store[Store] in the above measure with Store[Product] or Store[Location]
Like this:
Is there any way to create one and the only measure that can return the result (B-A) for any row filter that users may apply? In this case, they are Store[Store] , Store[Product] or Store[Location].
I do not know if there is any DAX that can detect which column is used as a row filter and send to ALL( ) as a variable.
Please kindly help, thank you!
Solved! Go to Solution.
Hi, @Anonymous
According to your description, I think you can simply modify your measure.
Like this:
measure =
VAR _current_mix_ =
DIVIDE (
SUM ( Store[Revenue] ),
CALCULATE (
SUM ( Store[Revenue] ),
ALL ( Store[Store] ),
ALL ( Store[Product] )
)
)
VAR _previous_mix_ =
DIVIDE (
CALCULATE ( SUM ( Store[Revenue] ), DATEADD ( Store[Year].[Date], -1, YEAR ) ),
CALCULATE (
SUM ( Store[Revenue] ),
DATEADD ( Store[Year].[Date], -1, YEAR ),
ALL ( Store[Store] ),
ALL ( Store[Product] )
)
)
RETURN
CONCATENATE ( FIXED ( ( _current_mix_ - _previous_mix_ ) * 100, 1 ), " pts" )If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
According to your description, I think you can simply modify your measure.
Like this:
measure =
VAR _current_mix_ =
DIVIDE (
SUM ( Store[Revenue] ),
CALCULATE (
SUM ( Store[Revenue] ),
ALL ( Store[Store] ),
ALL ( Store[Product] )
)
)
VAR _previous_mix_ =
DIVIDE (
CALCULATE ( SUM ( Store[Revenue] ), DATEADD ( Store[Year].[Date], -1, YEAR ) ),
CALCULATE (
SUM ( Store[Revenue] ),
DATEADD ( Store[Year].[Date], -1, YEAR ),
ALL ( Store[Store] ),
ALL ( Store[Product] )
)
)
RETURN
CONCATENATE ( FIXED ( ( _current_mix_ - _previous_mix_ ) * 100, 1 ), " pts" )If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 49 | |
| 35 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 92 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |