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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

DAX filtering help

I have some simple data with slicers on CUSTOMER, YEAR, and MONTH that just shows a summary table of their monthly charges. The wrinkle is that for a service there may be a negotiated monthly charge with a MONTH value of 0 that supercededs any actual CHARGES for any month

 

Customer	Service	Year	Month	Charges
CustA		X	2016	0	500
CustA		X	2016	1	120
CustA		X	2016	1	330
CustA		X	2016	1	200
CustA		X	2016	2	125

So if slicing the charges for 2016, 01 for this customer it would be 500 regardless of how much or little they actually used.

 

 

I'm wondering if I need a new calculated column that does a form of a coalesce

pseudocode:

coalesce( (service=x & value=0), sum(service=x & charges) )

 

Its a little ambiguous but if you have any thoughts I'd be happy to try them out

3 REPLIES 3
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Anonymous

 

In your scenario, this negotiated monthly charge is based on number of rows for Month 0, or the charge value for Month 0?

 

For first scenario, you measure can be like:

 

Mesure= IF(
CALCULATE(COUNTROWS('Table'),'Table'[Month]='0')>0,
CALCULATE(SUM('Table'[Charge]),'Table'[Month]='0'),
CALCULATE(SUM('Table'[Charge]))
)

For sceond scenario, your measure can be like:

 

 

Mesure= IF(
CALCULATE(SUM('Table'[Charge]),'Table'[Month]='0')>0,
CALCULATE(SUM('Table'[Charge]),'Table'[Month]='0'),
CALCULATE(SUM('Table'[Charge])))

 

Regards,

Baskar
Resident Rockstar
Resident Rockstar

Sorry i did't get u,

 

Do u want a new filed with some condition am i rigth ? 

my assumption 

Greg_Deckler
Community Champion
Community Champion

I would recommend using a measure, something like:

 

Measure = IF(CALCULATE(COUNTROWS('Table'),'Table'[Month]=0)>0,True Condition with 0 month value,False Condition with standard value)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
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.

Top Kudoed Authors