March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Solved! Go to Solution.
Hey,
I understand now.
You should consider to create a star schema, a one table solution has always its shortcomings
First I created a table Dimension Product using this DAX statement:
dimension product = DISTINCT('Sheet1'[Products])
Then I created a relationship between your data table (the fact table) and the new dimension product table:
I created a measure (it is more convenient) to reference the measure then to always write the complete formula:
Total Value = SUM('Sheet1'[Value])
Then I write the final measure:
Value showing zeros = var theValue = [Total Value] return IF(ISBLANK(theValue) , 0 , theValue)
This allows to create the following table:
Please be aware that the Products are coming from the Table "Dimension Product" and not from the data table. This is a best practice as well as data modeling using a star schema.
Regards,
Tom
Hey,
please prepare a pbix file that contains sample data and reflects your data model, upload the pbix to onedrive or sharepoint and share the link.
Regards,
Tom
Hey,
I understand now.
You should consider to create a star schema, a one table solution has always its shortcomings
First I created a table Dimension Product using this DAX statement:
dimension product = DISTINCT('Sheet1'[Products])
Then I created a relationship between your data table (the fact table) and the new dimension product table:
I created a measure (it is more convenient) to reference the measure then to always write the complete formula:
Total Value = SUM('Sheet1'[Value])
Then I write the final measure:
Value showing zeros = var theValue = [Total Value] return IF(ISBLANK(theValue) , 0 , theValue)
This allows to create the following table:
Please be aware that the Products are coming from the Table "Dimension Product" and not from the data table. This is a best practice as well as data modeling using a star schema.
Regards,
Tom
Hey,
the link you provided requires a login, I'm not going to login to download your sample data. Maybe you can provide another link or update the settings of that link.
Regards,
Tom
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |