cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Look for a value

Hi,

 

My got my data from PowerBI online service, which means I cannot edit the queries or build new tables and the only thing I can do is creating some measures. I'm trying to pick out 9 specific items and divide the case numbers by their pack sizes. Other items remain the same. The key to identify item is called "MIN", which is the item number. So what I did was first creating a measure since otherwise I won't be able to refer the fields that are alredy in the model:

MIN value = VALUES(ItemInfo[MIN])

Converting everything to value.

123.png

Here is the list of items that I need to make adjustments.

My idea is to use if statement like this:

IF(AND(ItemInfo[MIN] = "xxxxxxxx", ItemInfo[MIN] = "xxxxxxx".......), [cases]/pack size, [cases]). But seems it's not working.

Here is my function for the first item:

Revised 2018 Cases = IF(ItemInfo[MIN value] = "INACTIVE03208",[Cases 2018]/24,[Cases 2018])

[Cases 2018] is a measure under table TransData.

And the error is:

2.png

I would appreciate if anyone can help me address this issue

 

4 REPLIES 4
Highlighted
Microsoft
Microsoft

Re: Look for a value

@zengyuz,

I note that you create a measure after connecting to the Power BI Service dataset in Desktop.

MIN value = VALUES(ItemInfo[MIN])

You should get the following similar error when dragging the MIN value measure in a visual. VALUES() funtion returns a one-column table that contains the distinct values from the specified table or column. You are able to create a new table using VALUES() function in DAX formula.
1.JPG

Could you please share dummy data of your table and post expected result here?

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Look for a value

Thanks Linda! Is there a way I can share the file with you and have you take a look? Maybe through email? Thank you!

Highlighted
Microsoft
Microsoft

Re: Look for a value

@zengyuz,

I sent you Private Message.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Microsoft
Microsoft

Re: Look for a value

@zengyuz,

I am unable to access the PBIX file you share  to me. Please share me the PBIX file that you publish to Power BI Service.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (859)