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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Basmall_B
Frequent Visitor

Migrating from Tableau to Power BI using Dax

Hi

I am learning DAX and in the process of migrating a dashboard from Tableau to Power BI

Migrating a dashboard which shows the Active Billing accounts

This is what I have done in Tableau

I have a parameter in Tableau which shows the date and quarters. The user selects a quarter and the corresponding date gets checked with date values in a column The parameter is called Audit Period. So here is the logic that I am applying in Tableau.

 

// Flag bill records that contain Bill Period To >= end of audit period (parameter value in Tableau which will be the value that i will using to filter)

IF [Bill Period To] >= [Audit Period] THEN
      TRUE
ELSE
     FALSE
END

 

The logic checks selected value from the parameter dropdown as [Audit Period] and if that value is greater than or equal to the values in the [Bill Period To] against each Billing Account return a True if not False

 

My Slicer in Power Bi which works as the value input or filter. I have created a corresponding date column for each quarter on the custom table which I am using in this slicer.

 

filter.JPG

 

My Date column in the accounts table that iam trying to apply the logic to

Table.JPG

 

 

The aim is to populate a custom column with a True or False and then use that in a visual.

 

Any help would be appreciated.

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

10 REPLIES 10
Anonymous
Not applicable

Hi,

Is it a one to one mapping between Quarter and its corresponding date?

So, if I select 'Qtr 1 2018', will it return one corresponding date or all the dates in that quarter?

If the selection returns multiple dates, which date do you want to compare, max or min ?

Thanks.

Hi Vaibhav

 

Thank you for responding to my question. The idea is to get all the rows that match that quarter only for the Active accounts. If it falls with in that quarter it should return a True Else False.

 

Thank you for your time.

 

 

Anonymous
Not applicable

Hi @Basmall_B ,

So you want the values in the table to change every time the slicer value changes, which to my knowledge is difficult to achieve as calculated columns will not respond to slicer change.

Having said that, we can create a measure which returns True or False and then use that in a visual.

Thanks.

 

Thanks Vaibhav,

 

That is what I gathered  reading some of the posts,  after responding to your reply. May be dynamically changing the values in column may not be possible with changes in a slicer. But with my beginner level of knowledge I thought we may have a solution that I didn't know.

Taking your suggestion I can work with a measure as well which I  can; then use in a visual. How will I go about achieving this ?

 

 

 

Anonymous
Not applicable

Hi,

This is what i have done as of now.

When we select a quarter from the slicer, the table visual displays if that date falls in that quarter.

Do you want to have an additional True and False slicer?

result.PNG

Thanks.

Hi Vaibhav,

 

You are on the dot. This is what I was after. I can then use the count rows returned in my other visuals as well. I wont need any additional slicers with True and False. This will serve my purspose. What are the steps that I should follow to achieve the same behaviour.

 

Thank you.

Anonymous
Not applicable

Hi,

Create Below measures:

MinDate = CALCULATE ( MIN('Calendar'[date]), ALLSELECTED('Calendar') )

MaxDate = CALCULATE ( MAX('Calendar'[date]), ALLSELECTED('Calendar') )

Quarter Flag = 
VAR v_Date = CALCULATE( MAX( Transaction_Data[transaction_date] ) )
RETURN
IF( ( [MinDate] <= v_Date && [MaxDate] >= v_Date ), "True", "False" )

MinDate and MaxDate calculate the minimum and maximum date for the selected quarter.

Quarter flag checks if the date in the fact table falls in the selected range.

 

Please accept this as a solution if it satisfies the requirement.

 

Thanks.

Hi Vibhav,

 

Sorry it took me a while to respond. I was pulled into couple of other issues.

I was wondering if you could share the PBIX file so that I can recreate the measures and compare it to what you have done. I am almost close to getting this work. 

 

Thank you

 

B

Anonymous
Not applicable

Hello,

Here's a link to the pbix:

https://1drv.ms/u/s!AikPceQOhqFEhBNHgf4AHSZOm45J?e=4t7b2V

Thanks.

Hi Vibhav,

 

Your idea worked and saved me a lot of time in researching.

 

Thank you for your timely help.

 

B

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors