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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to set a column into a variable ?

Hi in my previous report they were using caluclated column, that was used in multiple charts, But performence wise it will take time to show the visual. Now i want to change that caluclated column into measure .

i tried multiple ways but wont work. it showing some errors.

This is the caluclated column .

 

LOB =
VAR PROJ='Wiser Jira Mapping'[Wiser Instance & solution mapping to Jira project]

VAR CAT=CALCULATE(MAX(DimProjects[CATEGORY])
,FILTER(ALL(DimProjects),DimProjects[NAME]=PROJ))

RETURN
IF(CAT=BLANK(),"NA",CAT)
 
Please let me know the solution if you found anything.
Thanks in advance
5 REPLIES 5
Ahmedx
Super User
Super User

try like this:

LOB =
VAR PROJ=
        CALCULATE(
                MAX('Wiser Jira Mapping'[Wiser Instance & solution mapping to Jira project]))

VAR CAT=CALCULATE(MAX(DimProjects[CATEGORY])
,FILTER(ALL(DimProjects),DimProjects[NAME]=PROJ))

RETURN
IF(CAT=BLANK(),"NA",CAT)

 

LOB =
VAR PROJ=
        MAX('Wiser Jira Mapping'[Wiser Instance & solution mapping to Jira project])

VAR CAT=CALCULATE(MAX(DimProjects[CATEGORY])
,FILTER(ALL(DimProjects),DimProjects[NAME]=PROJ))

RETURN
IF(CAT=BLANK(),"NA",CAT)

 

 

Anonymous
Not applicable

Hi Ahmed,

Its working 
but while iam using in matrix(Rows) it wont take the measure 
how can i set it into matrix in ROws section

Try and see if this works, by only replacing this line (and keep the rest of the measure code)

 

 

VAR PROJ=
        SELECTEDVALUE('Wiser Jira Mapping'[Wiser Instance & solution mapping to Jira project])

 

Anonymous
Not applicable

no not working

result is showing different

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors