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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Outdated product - DAX Measure

Hello, 

Basic information: 

dgadzinski_2-1670272967286.png

In "Green" calculation we had the change and it means: All Product > TODAY

 

I have an issue with measure because the measure is counting values incorrectly. I would like the measure to also take into account the individual days of the month but for rest days of December it doesn't display values: 

dgadzinski_0-1670272759947.png

How to change the calculation in this measure? 

 

dgadzinski_1-1670272810511.png

This is pbix file with my calculations: 

https://uewrc-my.sharepoint.com/:u:/g/personal/170361_student_ue_wroc_pl/EZopWei7GwFHjmyczp3DqQMBtpp...

 

Could you help me, please? 

 

1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

I think your calculation does not consider "diff = 0" scenario. See if the below works:

 

Measure 2 = 
var cur_yearly_review=SELECTEDVALUE('Table'[Yearly review])
var cur_date=TODAY()
var diff=DATEDIFF(cur_yearly_review,cur_date,MONTH)
-- return diff
return 
SWITCH(TRUE(),
       diff > 6, "More than 6 months",
       diff >= 0, "Less than 6 months",
       diff < 0, "All recertified")

 

sevenhills_0-1670368896931.png

 

View solution in original post

1 REPLY 1
sevenhills
Super User
Super User

I think your calculation does not consider "diff = 0" scenario. See if the below works:

 

Measure 2 = 
var cur_yearly_review=SELECTEDVALUE('Table'[Yearly review])
var cur_date=TODAY()
var diff=DATEDIFF(cur_yearly_review,cur_date,MONTH)
-- return diff
return 
SWITCH(TRUE(),
       diff > 6, "More than 6 months",
       diff >= 0, "Less than 6 months",
       diff < 0, "All recertified")

 

sevenhills_0-1670368896931.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.