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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
DK-C-87
Helper I
Helper I

Convert calculated column into a Measure

I've got this calculated column : 

Helper = 
VAR _1 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), HighlightGBS[HL - Business Cases] <> BLANK())
VAR _2 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), HighlightGBS[HL - Storbageri] <> BLANK())
VAR _3 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), HighlightGBS[HL - Bageri] <> BLANK())
VAR Samlet = _1 + _2 + _3
RETURN
Samlet

If I put this into a measure I do not get the same result. 
I have tried myself to make changes, so it should work, but without success. The closest i've got is this one : 

Helper = 
VAR _1 = COUNTX(HighlightGBS, CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), HighlightGBS[HL - Business Cases] <> BLANK()))
VAR _2 = COUNTX(HighlightGBS, CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), HighlightGBS[HL - Storbageri] <> BLANK()))
VAR _3 = COUNTX(HighlightGBS, CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), HighlightGBS[HL - Bageri] <> BLANK()))
VAR Samlet = _1 + _2 + _3
RETURN
Samlet

But it still don't work.

Anyone who can help, please ? 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @DK-C-87 - You can avoid using COUNTX because you're already working with distinct counts and conditions directly in CALCULATE.

 

Helper_Measure =
VAR _1 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), NOT(ISBLANK(HighlightGBS[HL - Business Cases])))
VAR _2 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), NOT(ISBLANK(HighlightGBS[HL - Storbageri])))
VAR _3 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), NOT(ISBLANK(HighlightGBS[HL - Bageri])))
VAR Samlet = _1 + _2 + _3
RETURN Samlet

 

Hopefully it works, If this still doesn't produce the expected results, you may need to check for how the data in HighlightGBS is structured

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
rajendraongole1
Super User
Super User

Hi @DK-C-87 - You can avoid using COUNTX because you're already working with distinct counts and conditions directly in CALCULATE.

 

Helper_Measure =
VAR _1 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), NOT(ISBLANK(HighlightGBS[HL - Business Cases])))
VAR _2 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), NOT(ISBLANK(HighlightGBS[HL - Storbageri])))
VAR _3 = CALCULATE(DISTINCTCOUNT(HighlightGBS[Plant]), NOT(ISBLANK(HighlightGBS[HL - Bageri])))
VAR Samlet = _1 + _2 + _3
RETURN Samlet

 

Hopefully it works, If this still doesn't produce the expected results, you may need to check for how the data in HighlightGBS is structured

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

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.