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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
NidhiBhusari
Helper IV
Helper IV

How to calculate day level sales by comparing two Date Field?

I need to implement this logic in PowerBI which calculates values at the Day level i.e when the Date selected from the slicer is equal to Policy Approval Date then only it should give me the output. Can anybody please help me with the DAX in Power BI?


Tableau:- Two parameters have been created for Start & End Date compared with Policy Approval Date.
PowerBI:- Created Calendar Table whose Date field is used in the slicer and is compared with Policy Approval Date.



NidhiBhusari_1-1647587258534.png

 

3 REPLIES 3
NidhiBhusari
Helper IV
Helper IV

There are two parameters created in Tableau for Start and End Date. which are compared with Policy Approval Date column. Please help me with the DAX for below logic.

NidhiBhusari_0-1647587759599.png

 

AND in DAX speak is &&

Instead of case ... when ... you can use SWITCH()

 

if you like more help please post a text version of the code.

Anonymous
Not applicable

Hi @NidhiBhusari ,

 

I'm not good at Tableau, you may try this formula.

measure =
var match_date = SELECTEDVALUE([Policy Approval]) = Selectedvalue([slicer])
return
switch(true(),

match_date&&[select measure] = "premiun in crores", [premiun]/10000000,

match_date&&[select measure] = "policies",[policycount],

...etc

)

If it doesn't work, please share some sample data and expected result.

 

Best Regards,

Jay

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors
Top Kudoed Authors