cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chirag_Sidana
Frequent Visitor

Changing Measure Values to Months/Days

Hi,

 

I have created a measure which calculates the number of days to achieve a certain target. However, since the # days are coming out to be 100+ for a lot of cases, I would also like to give the user an option to show the measure in # months if desired. So basically a click functionality where the user can chose to see the measure in months or days. This would have been simple in Tableau using parameters but I am not sure if Power BI parameters can be used the same way.

 

Thanks in advance,

Chirag

1 ACCEPTED SOLUTION

Accepted Solutions
alexei7 Continued Contributor
Continued Contributor

Re: Changing Measure Values to Months/Days

Hi Chirag,

 

The DATEDIFF DAX function should help with what you're trying to achieve.

 

You could create different measures using this function for Days, Weeks, Months difference etc and then have a slicer to allow the user to select one of these measures.

 

Hope that helps

Alex

View solution in original post

3 REPLIES 3
alexei7 Continued Contributor
Continued Contributor

Re: Changing Measure Values to Months/Days

Hi Chirag,

 

The DATEDIFF DAX function should help with what you're trying to achieve.

 

You could create different measures using this function for Days, Weeks, Months difference etc and then have a slicer to allow the user to select one of these measures.

 

Hope that helps

Alex

View solution in original post

Chirag_Sidana
Frequent Visitor

Re: Changing Measure Values to Months/Days

Thanks for your response Alex! I wasn't sure how DATEDIFF could fix this but I did create two measures - one for date and month each and used slicer to change the view between these two measures. This does help me achieve the view I wanted.

 

Thanks Again!

Chirag

 

alexei7 Continued Contributor
Continued Contributor

Re: Changing Measure Values to Months/Days

Great, glad I could help!

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors