Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello Team,
I have difficulty on converting this calc that is pulling from 2 different tables:
IF [X-Plant Material Status]="50" THEN (12-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY())))
ELSEIF [X-Plant Material Status]="60" THEN (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY())))
ELSEIF [X-Plant Material Status]="65" THEN (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY())))
ELSEIF [X-Plant Material Status]="70" THEN 0
ELSEIF [X-Plant Material Status]="75" THEN 0
ELSEIF [X-Plant Material Status]="80" THEN 0
ELSEIF [X-Plant Material Status]="85" THEN 0 END
Solved! Go to Solution.
@g-wizard So, in DAX that would be:
SWITCH( [X-Plant Material Status],
"50", (12-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"60", (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"65", (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"70", 0,
"75", 0,
"80", 0,
"85", 0
)
@g-wizard So, in DAX that would be:
SWITCH( [X-Plant Material Status],
"50", (12-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"60", (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"65", (6-(DATEDIFF('month',[Date from which the X-distr.-chain material status is valid (date)],TODAY()))),
"70", 0,
"75", 0,
"80", 0,
"85", 0
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |