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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Ruga
New Member

How to calcuate vehicle service loyalty with DAX messures?

I am creating a report and I`m having som problems of getting the correct visuals.

 

What I`m after is to display vehicle serivce loyalty (customer loyalty) per dealership. 

 

tables i can work with

 

Sales_2019 one dealer_ Invoice_Date

Vehicle_registration_date_Total_Vehicles(Whole country).

Belonging_Dealership (Which licence plate belonging to which dealership)

 

 

So far I am able to display total vehiclemaintenance made by  vehicle registration year for the specific dealer based on sales in 2019. What I need in addition is to display on the same column chart is total vehicles avaiable by the belonging dealer on top of the chart to see how many of the vehicles that "belongs" to this dealer actually shows up for vehicle maintenance. 

 

Ruga_0-1604996740653.png

I tried the "all" expression but I`m not able to use it in the chart without getting an error. Also if I unfilter the table (registration date), all of the vehicles in the whole country not only the belonging dealership will be displayed. The numbers will be too high if the whole country is the reference and not the specific dealership.

How can I solve this issue?

 

 

 

 

 

 

is?

1 ACCEPTED SOLUTION
Ruga
New Member

I resolved this by adding the total  cars as a secondary axis. 

View solution in original post

5 REPLIES 5
Ruga
New Member

I resolved this by adding the total  cars as a secondary axis. 

AlB
Community Champion
Community Champion

@Ruga 

I begin to understand, but not completely I'm afraid.I'd need to see the code for the measure you are using in the very first chart you show?

and  the code for the measure that returns the error.

The code might help clarify what you are trying to do.

It would help too if you can share the pbix

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

Ruga_0-1605269940458.png

 

Hi @AlB . I tried to remove the filter on registration numbers by using "all" function in a new measure. Now I am not able to place this new measure under values in the chart.  Im not sure if this is the correct way to do this.?

 

 

 

 

 

AlB
Community Champion
Community Champion

Hi @Ruga 

I don't quite understand what you are trying to do. Can you show the code for the measure that returns the error. And the code for the measure you are using in the chart? Showing a sample of your tables and their relationships would be of help

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

Ruga_0-1605009210812.png

 

This shows the amount of invoices in regards of registration dates of vehicles. this is OK, but I dont see how many of the total cars registrated in the dealership responsibility that shows up.  It should look something like this

 

Ruga_1-1605009418538.png

Dark blue: Total vehicles available:

Light blue: vehicles showed up for maintenance.

in this example the loyalty is 50%, but in reality the loyalty do decline with age. 

 

tables

Ruga_2-1605009722633.png

 

Table_ MF_Drammen_Invoice_2019 example:

Ruga_3-1605009775947.png

 

does this make any sense @AlB ?

 

 

 

 

 

 

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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