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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
mukhan169
Helper III
Helper III

Dax Adding filter to the measure

Good morning experts,

I have a table with field MISGroup that contains 0,3,12 or 24 in it.

For the following measure, how do I just add "where MISGroup=3" 

 

IPTV =
IF(ISBLANK([Total By MIS]) && [Sum of Sales]>0 && table[MISGroup]=3 |
0
|Divide([Running Total By MIS]|[Sum of Sales]|0)*1000
)

 

9 REPLIES 9
parry2k
Super User
Super User

@mukhan169 something like this

 

Sum Sales = CALCULATE( SUM(Table[Sales]), Table[MISGroup]=3)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k Thank you but

Only add 0 for MISGroup =3. Otherwise dont. So this one wont work.

Thanks for your reply

@mukhan169 try this

 

Sum Sales = 
VAR s = CALCULATE( SUM(Table[Sales]), Table[MISGroup]<>3)
RETURN
IF( ISBLANK(s), 0, s )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k  thank you again.

I just tried this 

IPTV Test = CALCULATE(TRUE()|Claims[MISGroup]=3)
so I can later check for true or false in my if condition.
It produces that result. I know I am missing something very basic. it should be false for 12. again greatly appriciate your help.IPTVTest.PNG

@mukhan169 to be very honest, without looking at sample data it is very hard to provide the solution. If you can share sample data in excel will help a lot. It will save both of our time.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 

I have sample data file loaded here

https://community.powerbi.com/t5/Desktop/Cumulative-Total-per-group-and-month-which-fill-the-missing...

this is a very smart part of a bigger problem I am trying to solve.

its a chart for 3,12 and 24 MIS which are not supposed to cross over each other. I only want to apply formula for 3 mis group for now.

Hi @mukhan169 

You may add formula ...&&MAX(Claims[MISGroup])=3.Test it with your sample file as below.

1.png

Regards,

 

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

@v-cherch-msft 
Thank  you but it still doesnt work, its showing nothing for MIS where the count is zero. I am baffeled . But appriciate your help.

3MIS.PNG

Hi @mukhan169 

Could you show us your measure and provide a  clear illustrative example about your expected output?

Regards,

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

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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