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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Help needed with DAX function used in a measure

The below is a measure, which i am expecting to returning 1 to max -1 or max when the value of company order date is max. I am not getting the correct value of the first vMaxIndex , it shiuld be 12, but it is coming as 19. ANy clues of whats wrong? I am using the return values to test, later teh return variable values will need to be replaces by calcluate expressions. Thanks
 
Previous Period Manage Seats = var vMaxIndex = CALCULATE(MAX('Company Detail'[Company Date Order] ),FILTER(All('Company Detail'),MAXX(Filter('Company Detail', Earlier('Company Detail'[Company_RecID])='Company Detail'[Company_RecID]),'Company Detail'[Company Date Order] ) ))

var vCurrenttIndex=CALCULATE(MAX('Company Detail'[Company Date Order] ),FILTER(All('Company Detail'),MAXX(Filter('Company Detail', Earlier('Company Detail'[Company_RecID])='Company Detail'[Company_RecID] && Earlier('Company Detail'[Date_Inserted])='Company Detail'[Prior Month]),'Company Detail'[Company Date Order] )))

var vFirstMgmSeats= 0
return
IF( AND(vCurrenttIndex=vMaxIndex,vCurrenttIndex=vMaxIndex) ,

CONCATENATE( vMaxIndex,CONCATENATE(" , " , vCurrenttIndex))
,
CONCATENATE( vMaxIndex,CONCATENATE(" , " , vCurrenttIndex)) )

image.png

1 REPLY 1
Anonymous
Not applicable

Hi may I know if any one has any resolutions for this?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.