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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BigBadBob
Helper I
Helper I

Dax Measure

I think i am having a really off day today. I can not even see where to upload the PBIX file i have prepared.....

Anway, heres the prob and let me know if you would like the pbix file / where to upload

 

Requirement: A measure to show the difference between

  • A = ‘FACT’[Date Due] (calculated Column)
  • B = Selected Date (Measures table) driven by a slicer

 

If the answer is <0 give 0, if not give A-B

 

Thanks All

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@BigBadBob - If you do not have privileges to attach files, you generally have to use OneDrive, Box or some other file sharing service and post a link.

 

If I understand the question correctly, should be something like:

Measure =
  VAR __Diff = ( MAX('FACT'[Date Due]) - SELECTEDVALUE('Table'[Date]) ) * 1.
RETURN
  IF(__Diff < 0, 0, __Diff)


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

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @BigBadBob ,

 

Would you please inform us more detailed information( your  data(by OneDrive for Business)) if possible? Then we will help you more correctly.

 

Please do mask sensitive data before uploading.

 

Thanks for your understanding and support.

 

Best Regards,

Dedmon Dai

Greg_Deckler
Community Champion
Community Champion

@BigBadBob - If you do not have privileges to attach files, you generally have to use OneDrive, Box or some other file sharing service and post a link.

 

If I understand the question correctly, should be something like:

Measure =
  VAR __Diff = ( MAX('FACT'[Date Due]) - SELECTEDVALUE('Table'[Date]) ) * 1.
RETURN
  IF(__Diff < 0, 0, __Diff)


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...
aj1973
Community Champion
Community Champion

Hi,

You cannot upload or attach a PIBX file in here, you need to provide a link where to find it, like google drive or dropbox. 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.