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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Chanise89
Helper I
Helper I

Another option to write a CALCULATE function

I need some assistance with trying to rewrite a DAX without the use of CALCULATE:

Chanise89_0-1707233307983.png

 

I am trying to recreate a solution from another post, however I keep running into this error message:

Chanise89_1-1707233371077.png

I think it is coming from my Calculate funtion in the DAX to create to the Q122_PF measure. Is there a way to rewrite this and still get the same result?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Chanise89 ,

 

Try to modify your measure like below:

Variance select 1 =
SWITCH (
    TRUE (),
    VALUES ( 'var dropdown #2'[#1] ) = "Q122_Actuals", [Q122_Actuals 2],
    VALUES ( 'var dropdown #2'[#1] ) = "Q122_Plan", [Q122_PF 2],
    BLANK ()
)

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Chanise89 ,

 

Try to modify your measure like below:

Variance select 1 =
SWITCH (
    TRUE (),
    VALUES ( 'var dropdown #2'[#1] ) = "Q122_Actuals", [Q122_Actuals 2],
    VALUES ( 'var dropdown #2'[#1] ) = "Q122_Plan", [Q122_PF 2],
    BLANK ()
)

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Syk
Resident Rockstar
Resident Rockstar

Your error is saying that your measure 'Variance Dropdown 1' has the error...

Either way, try this 

Q122_PF =
CALCULATE (
    SUM ( 'GL Data'[P_FCST_AMOUNT_W] ),
    FILTER ( 'GL Data', 'GL Data'[VCH_QUARTER] = "Q1" && 'GL Data'[N_YEAR] = 2022 )
)

@Syk Variance Dropdown 1 is a table.


I am trying to wirte a measure that will allow me to use Measure names in a slicer (Similar to how Field parameters work but for my use case - field parameters is not the best option) 

So ultimately I am trying to create this measure:

Chanise89_0-1707236253228.png

 

The data types for all of these columns are Text, but I believe the actual error is leading back to the mesaure used to create Q122_Actuals 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.