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.
Hi!
Can`t solve the problem: I need to create a calculated column that includes campaings periods in "dd.mm.yyyy - dd.mm.yyyy" format.
I have dim_dates table that has a lot of information (e.g., [date] has time in a "dd.mm.yyyy" format) and dim_campaign table with campaing`s ids. These two tables are connected by a fact table.
So, what should I do to get the periods in the neccessary format?
I’m sorry! Don’t know whether I understood your question correctly, but I think you must format your table fields correctly first and then relate them with fields which are in the same type. Depending on your data table select either single join or both join under join options.
What is the common field to both tables?
There is dates_id and campaigns_id fields in the fact table.
Generically speaking; with the tables correctly joined one can create:
Campaign Min(Date) Max(Date)
You can do this at the table level, via a calculated table/field if you want to establish that permanently for other uses - or - the table visual will give you this as a presentation, by dragging the Date field twice and using the field setting options.
Date formating option is available in Modeling in the ribbon as a selection and if you need something more unique that isn't offered there then one would use a Dax format statement via measure or calculated field.
I have created a calculated column Period= CALCULATE ( FORMAT ( MIN ( dim_dates[date] ); "dd.mm.yyyy" ) ) & " - " & CALCULATE ( FORMAT ( MAX ( dim_dates[date] ); "dd.mm.yyyy" ) )
but it doesnt work quite right.
In the table view it shows me the result as in the photo for one campaing, instead of one row with 11.06.2017-14.06.2017
Desired Output=CALCULATE(MAX([Check]),
FILTER(Table1,[Name]=EARLIER([Name]))
)
Here's a model of a Max creation that maybe helps you craft your design
I would do Max and Min in separate fields at first - they may be useful by themselves for other purposes in the long run - and then you can make a 3rd field that is them together as you seek.....
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |