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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kumsha1
Post Patron
Post Patron

Measure error while using VALUES

Hi,

 

VALUES used in below measure calculation is returning error, can someone help to rewrite the DAX...[Status] values can be NULL, 0,100,2,3,4,5....TIA

 

DAILYCValue = IF(VALUES('VOD'[Status])=2,[CValueTARGET]*100,
IF(VALUES('VOD'[Status])=3,[CValuePLAN]*100,
VALUES('VOD'[Status])))
 
kumsha1_0-1637213308324.png

 

1 ACCEPTED SOLUTION
rbriga
Impactful Individual
Impactful Individual

Than you need an itirator.

Try

SUMX(

VALUES('Calendar'[Date]),

SWITCH(

'VOD'[Status],

2, [CValueTARGET]*100, --{or, if this isn't a measure, 'VOD'[CValueTARGET]*100}

3, [CValuePLAN]*100,

'VOD'[Status]

)

 

You may need to replace VALUES('Calendar'[Date]) by the field you're iterating over (I'm not sure wether it's by date, by products, both, etc...)

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @kumsha1 ,

 

Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thanks in advance for your kind cooperation!

 

Hope it helps,


Community Support Team _ Caitlyn

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

rbriga
Impactful Individual
Impactful Individual

How about:

SWITCH(

SELECTEDVALUE('VOD'[Status]),

2, [CValueTARGET]*100, --{or, if this isn't a measure, SELECTEDVALUE('VOD'[CValueTARGET])*100}

3, [CValuePLAN]*100,

SELECTEDVALUE('VOD'[Status])

)

 

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Hi @rbriga,

 

this is working ok with the measure values but the measure TOTALS are not displaying...

rbriga
Impactful Individual
Impactful Individual

Than you need an itirator.

Try

SUMX(

VALUES('Calendar'[Date]),

SWITCH(

'VOD'[Status],

2, [CValueTARGET]*100, --{or, if this isn't a measure, 'VOD'[CValueTARGET]*100}

3, [CValuePLAN]*100,

'VOD'[Status]

)

 

You may need to replace VALUES('Calendar'[Date]) by the field you're iterating over (I'm not sure wether it's by date, by products, both, etc...)

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!
amitchandak
Super User
Super User

@kumsha1 , Try like

DAILYCValue = IF(Max('VOD'[Status])=2,[CValueTARGET]*100,
IF(Max('VOD'[Status])=3,[CValuePLAN]*100,
max('VOD'[Status])))

 

You can also try switch true

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

MAX will work to satify the IF conditions but ELSE will always show MAX(Status) for all other scenarios whereas we need to show actual status.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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