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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I am doing something like this -
Solved! Go to Solution.
Try storing the MEASURE value in a variable first
Revenue =
VAR myMEASURE = [MonthYear]
RETURN
CALCULATE (
SUM ( fact[Revenue] ),
FILTER ( fact, fact[fiscalMonth] = myMEASURE )
)
Hi @sqldev2017,
What do you want to use this measure for? what is the context and calculation you arre making on the other measure where this one is used?
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português
I simply want to return one string value from a table, based on a filter.... That filter will always return one string value (for that table).
I understand CALCULATE is only for numeric measures...
But in this instance CALCULATE also seems to return a string !
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsI am doing something pretty straightforward.
My first "calculated measure" "MonthYear" returns a value say = "December 2018"
I use this calculated measure "MonthYear" in a different calculated measure as a Filter parameter -
"Revenue" = CALCULATE(SUM(Revenue), FILTER("fact", fact.fiscalMonth = MonthYear))
I can verify that MonthYear measure actually returns "December 2018"
But Revenue measure returns a blank value.
When I replace the MonthYear parameter , with a hard coded value
"Revenue" = CALCULATE(SUM(Revenue), FILTER("fact", fact.fiscalMonth = "December 2018" )) - Now this returns proper revenue value.
I do not understand why this is happening ! This is just so Bizzare.
Try storing the MEASURE value in a variable first
Revenue =
VAR myMEASURE = [MonthYear]
RETURN
CALCULATE (
SUM ( fact[Revenue] ),
FILTER ( fact, fact[fiscalMonth] = myMEASURE )
)
That worked like a Charm.
Thank You.
Honestly, I was trying to do this FORMAT(Measure, "String") , that was not working.
This worked.
Glad it worked.
When you use a MEASURE inside a FILTER function, it is evaluated for each row of the Table inside FILTER function (in your case it is FACT table)
That's why we have to store its value first in a variable
FILTER ( fact, fact[fiscalMonth] = [Measure] )
)
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 45 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 108 | |
| 39 | |
| 33 | |
| 25 |