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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
nankerp
Helper III
Helper III

DAX Measure - Change filter context (one products value to other products value)

I made measures

Total sale (Totalsalg), 

Sale Kiwi (Salg Kiwi)

Sale Kiwi and pears=Kiwi value (Kiwi og Pærer = Kiwi Salg)

 

The last measure look like this: =CALCULATE([Salg Kiwi];factData[Vare]="Kiwi";factData[Vare]="Pærer")

 

I dont want values for apple (epler). The yellow cell should not be there. How can I make the measure?

Problem - DAX.png

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF(HASONEVALUE(factData[Vare]),IF(VALUES(factData[Vare])="Epler",Blank(),[Salg Kiwi]),[Salg Kiwi])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF(HASONEVALUE(factData[Vare]),IF(VALUES(factData[Vare])="Epler",Blank(),[Salg Kiwi]),[Salg Kiwi])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you very much. This work.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Zubair_Muhammad
Community Champion
Community Champion

@nankerp

 

Try this MEASURE

 

Measure =
CALCULATE ( [Salg Kiwi], KEEPFILTERS ( factData[Vare] IN { "Kiwi", "Pærer" } ) )

Regards
Zubair

Please try my custom visuals

Thank you. Its not working.

 

The values 3000 for epler has not disappered.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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