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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Replacement for FIRSTNONBLANK in calculated column in DirectQuery mode

Hello,

I am trying to recreate dynamic report from this video: https://www.youtube.com/watch?v=aQKDHy4_pgs
but I have to work in DirectQuery mode. I was able to build all but one dynamic column. I can't use FIRSTNONBLANK function.
= SWITCH(

FIRSTNONBLANK ('Dynamic Slicer'[Metric Choice], 1 ),

"Product", RELATED ('Internet Sales' [Product Name]),

"Promotion", RELATED ('Internet Sales' [Promotion Name]),

"Promotion Category",  RELATED ('Internet Sales' [Promotion Category]),

"Sales Region", RELATED ('Internet Sales' [Sales Region])

)

Any ideas how I can modify above DAX to create calculated column in DirectQuery?

Thank you!

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Has your problem been solved?

According to @lbendlin ‘s suggestion you can check the following example.

Measure with FIRSTNONBLANK = SWITCH(

FIRSTNONBLANK ('Dynamic Slicer'[Metric Choice], 1 ),

"Product", "expression1",

"Promotion", "expression2",

"Promotion Category",  "expression3",

"Sales Region", "expression4"

)

Now we can replace FIRSTNONBLANK with MAX.

Measure with MAX = SWITCH(

MAX ('Dynamic Slicer'[Metric Choice]),

"Product", "expression1",

"Promotion", "expression2",

"Promotion Category",  "expression3",

"Sales Region", "expression4"

)

Both of these measures return the same result. And the MAX function is applicable in DQ mode.

7.png

 

Best Regards,

Stephen Tao

 

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

lbendlin
Super User
Super User

Have you tried using MINX or CALCULATE(MIN()) or similar techniques? What business story are you trying to tell?

Anonymous
Not applicable

@lbendlin  It wont work with DirectQuery mode I have to use

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors