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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Create conditional flag

Hello!

I have an typical issue. In my cube, I have some project related data. That has version number. So for example, 

Project number        Version

36002                         v001

36002                         v002

36390                         v001

 

Now in the report, if a user selects the project then the data attached to latest version (for project 36002-- v002, for project 36390-- v001) should be shown. One way to solve is to create a flag which can be then used to filter the report like:

Project number        Version      IsActive

36002                         v001              0

36002                         v002              1

36390                         v001              1

 

This flag is currently not available in the cube. So I will need to create it. What DAX query should be used to update this flag?

 

Regards

Priya

1 ACCEPTED SOLUTION
Anonymous
Not applicable

are you working in import or direct query?

can you strip the "v" so the version number will be an actual integer?


If so, you could have a calculated column with 
IsLatest=
var thisProject=Yourtable[ProjectNumber]
VAR thisVersion=YourTable[Version]
RETURN
IF(MAXX(FILTER(YourTable;YourTable[ProjectNumber]=thisProject);Yourtable[Version])=thisVersion;1;0)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

are you working in import or direct query?

can you strip the "v" so the version number will be an actual integer?


If so, you could have a calculated column with 
IsLatest=
var thisProject=Yourtable[ProjectNumber]
VAR thisVersion=YourTable[Version]
RETURN
IF(MAXX(FILTER(YourTable;YourTable[ProjectNumber]=thisProject);Yourtable[Version])=thisVersion;1;0)

Anonymous
Not applicable

Thank you @Anonymous for the quick reply. I am using direct query for reading the data. Yes i can create one more calculated column where i dont take "v" into version number

 

Regards

Priya

Anonymous
Not applicable

I'm not really practical with DirectQuery so I don't know if that works, to be honest

Anonymous
Not applicable

@Anonymous : That solution worked! Thanks! 🙂

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.